Notes in Bash fundamentals

To Subscribe, use this Key


Status Last Update Fields
Published 07/10/2024 print the shell's working directory
Published 07/10/2024 move up to the parent directory
Published 07/10/2024 move to the root directory
Published 07/10/2024 move to your home directory
Published 07/10/2024 print your username
Published 07/10/2024 make directories dir1, dir2, dir3
Published 07/10/2024 make directories dir3 inside dir2 inside dir1
Published 07/10/2024 make a directory my folder
Published 07/10/2024 print the contents of the working directory
Published 07/10/2024 print the concatenation of file1 and file2
Published 07/10/2024 write the working directory's listing to output.txt
Published 07/10/2024 print the concatenation of all .txt files
Published 07/10/2024 append file1 to file2
Published 07/10/2024 view large_file.txt page-by-page
Published 07/10/2024 move my_file to dir
Published 07/10/2024 move all files from dir to working directory
Published 07/10/2024 move file1 and file2 to dir
Published 07/10/2024 copy dir/my_file to working directory
Published 07/10/2024 copy the contents of file1 into file2
Published 07/10/2024 rename file1 as file2
Published 07/10/2024 remove file1 and file2
Published 07/10/2024 delete dir
Published 07/10/2024 remove all files in working directory in interactive mode
Published 07/10/2024 remove recursively dir and its contents
Published 07/10/2024 print the line count of file
Published 07/10/2024 display the manual for the uniq command
Published 07/10/2024 pipe stdout of cmd1 as stdin to cmd2
Published 07/10/2024 print the line-sorted concatenation of file1 and file2
Published 07/10/2024 print the number of different lines in file
Published 07/10/2024 switch to username's account
Published 07/10/2024 switch to the root user
Published 07/10/2024 clear the terminal screen
Published 07/10/2024 list the working directory, including hidden files and folders
Published 07/10/2024 What does Bash stand for?
Published 07/10/2024 print the type of my_file
Published 07/10/2024 Bash. It's sensible to {{c1::check using ls}} before you use rm with wildcards.
Published 07/10/2024 Bash. What are the four kinds of commands?
Published 07/10/2024 print information about cmd, e.g. whether it's a built-in
Published 07/10/2024 print help for a shell builtin cmd
Published 07/10/2024 print the first 10 lines of file
Published 07/10/2024 print the disk usage of files in working directory, recursively for directories
Published 07/10/2024 list all .txt files recursively in the working directory
Published 07/10/2024 list files recursively in the home directory which are case-insensitively named foobar
Published 07/10/2024 print 147 squared
Published 07/10/2024 create directories named <L>-<D> for each letter from h to r and digit from 2 to 12
Published 07/10/2024 print the user's environment variables and their values
Published 07/10/2024 print the value of the PATH environmental variable
Published 07/10/2024 set an alias la for ls -la
Published 07/10/2024 print the value of var
Published 07/10/2024 print the exit code of the latest command
Published 07/10/2024 execute cmd1 then cmd2
Published 07/10/2024 list all items in the working directory containing the letter 's'
Published 07/10/2024 print user foo's home directory
Published 07/10/2024 print the path to the cp executable
Published 07/10/2024 print $PATH (literally)
Published 07/10/2024 Bash. Any entered text is {{c1::expanded}} before it's executed.
Published 07/10/2024 print the long listing of the mv program
Published 07/10/2024 indicate the end-of-file
Published 07/10/2024 Bash. What do you put at the top of a script to indicate that it should be interpreted with Bash?
Published 07/10/2024 list the contents of your home directory and the /usr directory
Published 07/10/2024 list the contents of dir, sorted by file size
Published 07/10/2024 list the working directory's contents, sorted by modification time
Published 07/10/2024 copy to dir those .html files in the working directory which are newer or don't exist in the destination directory
Published 07/10/2024 create a hard link to file named foo
Published 07/10/2024 create a symbolic link to file named foo
Published 07/10/2024 delete symbolic_link1 and symbolic_link2
Published 07/10/2024 Bash. To get information about a command, use {{c1::help}} for {{c2::a shell builtin}} and {{c1::man}} for {{c2::an executable}}.
Published 07/10/2024 search the man pages for "partition"
Published 07/10/2024 print the environment's aliases
Published 07/10/2024 remove the alias foo
Published 07/10/2024 create or truncate the file foo
Published 07/10/2024 run cmd, redirecting its stderr to file
Published 07/10/2024 write both stdout and stderr of cmd to foo
Published 07/10/2024 append both stdout and stderr of cmd to foo.txt
Published 07/10/2024 run cmd, suppressing anything written to stderr
Published 07/10/2024 print duplicate adjacent lines, one for each group, from file
Published 07/10/2024 print the last 8 lines of big_file
Published 07/10/2024 write dir's listing to file1 and file2 and also print it
Published 07/10/2024 Bash. What does grep stand for?
Published 07/10/2024 print a one-line description of the cp command
Published 07/10/2024 print the command history
Published 07/10/2024 execute command number 86 in the command history
Published 07/10/2024 Bash. What do the ten characters making up the file attributes represent?
Published 07/10/2024 In a Unix-like operating system, what do the file attributes -rwx------ mean?
Published 07/10/2024 In a Unix-like operating system, what do the file attributes -rwxr-xr-x mean?
Published 07/10/2024 In a Unix-like operating system, what do the file attributes lrwxrwxrwx mean?
Published 07/10/2024 In a Unix-like operating system, what do the file attributes drwxrwx--- mean?
Published 07/10/2024 give the owner read and write permission for foo and remove all other permissions
Published 07/10/2024 add execute permission for the owner of file
Published 07/10/2024 display dynamic, real-time information about system processes
Published 07/10/2024 print information about all your running processes with controlling terminals
Published 07/10/2024 list running processes, no matter which terminal (if any) controls them
Published 07/10/2024 change the prompt string to "$ "
Published 07/10/2024 install emacs (on a Debian system)
Published 07/10/2024 uninstall emacs (from a Debian system)
Published 07/10/2024 upgrade all installed packages (on a Debian system)
Published 07/10/2024 print a description of the emacs package (on a Debian system)
Published 07/10/2024 print all pathnames containing 'bin/zip'
Published 07/10/2024 Ways to search the file system in Bash:(1) {{c1::locate}} searches by {{c2::pathname}}(2) {{c1::find}} searches by {{c2::a variety of attributes, recu…
Published 07/10/2024 print the number of files recursively in your home directory
Published 07/10/2024 list directories recursively in your home directory
Published 07/10/2024 list all regular files recursively in the home directory whose name ends '.jpg' of size at least 1M
Published 07/10/2024 list all files recursively in your home directory which have extension .js and size at least 2k, or extension .py and size at most 5k
Published 07/10/2024 find recursively in the home directory all regular files with extension .bak and delete them
Published 07/10/2024 find all files recursively in the home directory with extension .jpg and long list each
Published 07/10/2024 find all files recursively in the home directory with extension .log and interactively execute cat on each
Published 07/10/2024 remove each file listed in files.txt
Published 07/10/2024 update the access and modification time of file to current time
Published 07/10/2024 list files recursively in your home directory, up to depth 3
Published 07/10/2024 list all files in the /usr/bin directory whose names contain 'zip'
Published 07/10/2024 search for bzip in all .html files in working directory and print lines with a match
Published 07/10/2024 search for "needle" in all .bak files in dir and print lines with a match
Published 07/10/2024 search for "foobar" in .txt files and list files with a match
Published 07/10/2024 search for needle in all .txt files in working directory and print files without a match
Published 07/10/2024 print the count of lines with a match for pattern for each .txt file in the working directory
Published 07/10/2024 search for <ul> in all .html files in working directory and print lines without a match
Published 07/10/2024 print file, including non-printing characters
Published 07/10/2024 print file and number lines
Published 07/10/2024 print file, but number the lines and collapse consecutive blank lines
Published 07/10/2024 print file, after a reverse numerical sort on its fifth field
Published 07/10/2024 print file, after a reverse sort on its third field ignoring leading whitespace
Published 07/10/2024 print the disk usage for each file in dir
Published 07/10/2024 print the ten largest consumers of disk space for files in dir
Published 07/10/2024 print file, after an alphabetic sort on the first field then a reverse numeric sort on the second field
Published 07/10/2024 print unique lines from file, preceded by their counts
Published 07/10/2024 compare file1 and file2 line-by-line and print lines in one, other, or both in different columns
Published 07/10/2024 compare file1 and file2 line-by-line and print lines unique to file2
Published 07/10/2024 print file, after translating lowercase characters to uppercase
Published 07/10/2024 delete carriage return characters from file1 and write to file2
Published 07/10/2024 encode plaintext using ROT13 and write to ciphertext
Published 07/10/2024 collapse consecutive 'x' or 'y' in file1 and write to file2
Published 07/10/2024 replace the first occurrence of 'this' in each line of file with 'that', and print result
Published 07/10/2024 replace all occurrences of 'this' in file with 'that', and print result
Published 07/10/2024 list in long format the working directory's contents
Published 07/10/2024 Bash. What is the form of a shell function?
Published 07/10/2024 execute cmd1, then, just if it was successful, execute cmd2
Published 07/10/2024 execute cmd1, then, just if it wasn't successful, execute cmd2
Published 07/10/2024 one-off change the value of HOME to / then run cd
Published 07/10/2024 Kinds of expansion in Bash:{{c1::parameter}} {{c2::$var}}{{c1::command substitution}} {{c2::$(which mv)}}{{c1::arithmetic}} {{c2::$((147**2))}}{{c1…
Published 07/10/2024 print a packet's path to dest over the internet
Published 07/10/2024 connect via telnet to example.org on port 80
Published 07/10/2024 send a GET request to example.com and print the response body
Published 07/10/2024 send a GET request to example.com on port 80 and print the response body
Published 07/10/2024 send a GET request to example.com and save the response body as bloop.html
Published 07/10/2024 send a GET request to example.com/index.html and save the response body using the remote name
Published 07/10/2024 send a GET request to github.com, following redirects, and print the response body
Published 07/10/2024 send a GET request to example.com and print the response, including headers
Published 07/10/2024 read a line from stdin and store it in the REPLY variable
Published 07/10/2024 read a line from stdin, split it on whitespace, and assign the parts to variables foo, bar, and baz
Published 07/10/2024 set the shell variable foo to 'spam'
Published 07/10/2024 print var's value if it's non-empty
Published 07/10/2024 print 'blah' if int1 is less than or equal to int2
Published 07/10/2024 print 'bloop' if the working directory contains hello_world.sh
Published 07/10/2024 print 'less' if int's value is less than 10 else print 'not less'
Published 07/10/2024 print 'bingo' if path/to/this is a regular file and path/to/that is a directory
Published 07/10/2024 print 'bingo' if path/to/this is a regular file or path/to/that doesn't exist
Published 07/10/2024 while i is less than or equal to ceil print and increment i
Published 07/10/2024 until i is less than min print and decrement i
Published 07/10/2024 print each item in var
Published 07/10/2024 define a function print_args which prints its first and second arguments
Published 07/10/2024 Visualize the typical flow of data through a Bash command.
Published 07/10/2024 print dir/* (literally)
Published 07/10/2024 execute in the current shell the commands from my_file
Published 07/10/2024 mark the variable foo for export to the environment of later commands
Published 07/10/2024 unset foo's export attribute
Published 07/10/2024 list exported variables and functions
Published 07/10/2024 mark func for export to the environment of later commands
Published 07/10/2024 decompress file.gz
Published 07/10/2024 print the filename stored in var stripped of leading directory components
Published 07/10/2024 print the filename stored in a_filepath stripped of leading directory components and .txt suffix
Published 07/10/2024 assign var3 to the concatenation of var1 and var2's values
Published 07/10/2024 assign var2 to the concatenation of var1's value and 'blah'
Published 07/10/2024 change every .txt file in working directory to .md
Published 07/10/2024 list files with a single vowel as name and any extension
Published 07/10/2024 list files with a single non-vowel as name and any extension
Published 07/10/2024 list files in the working directory with a two-letter extension
Published 07/10/2024 add /usr/sbin to your PATH
Published 07/10/2024 list jobs
Published 07/10/2024 run takes_long_time.py as a background job
Published 07/10/2024 Bash. How do you suspend a job running in the foreground?
Published 07/10/2024 run job 2 in the background, as if it had been started with &
Published 07/10/2024 foreground job 5
Published 07/10/2024 temporarily set an environment variable foo to bar then run my_script.sh
Published 07/10/2024 print the value of the variable whose name is var's value
Published 07/10/2024 Bash. In less, how do you search forward for 'foobar'?
Published 07/10/2024 change your password
Published 07/10/2024 list dotfiles, excluding . and ..
Published 07/10/2024 Bash. In the snippetfoo=bar export quz=qux foo is a {{c1::shell}} variable, available to {{c2::the shell only}}, and quz is an {{c1::environment}} va…
Published 07/10/2024 send a TERM signal to process #15
Published 07/10/2024 send an interrupt signal to process #68702
Published 07/10/2024 send a STOP signal to process #861
Published 07/10/2024 send a CONT signal to process #451
Published 07/10/2024 send a KILL signal to process #666
Published 07/10/2024 compress big_file into gzip format
Published 07/10/2024 create archive.tar from file1, file2, and file3
Published 07/10/2024 unpack archive.tar
Published 07/10/2024 copy data from this_file to that_file in 4 blocks of 8 bytes
Published 07/10/2024 copy data from this_file to that_file in 5 blocks of 1024 bytes, skipping the first 3 blocks
Published 07/10/2024 copy data from foo.txt to stdout in 1 block of 32 bytes
Published 07/10/2024 mount the Fourth Extended filesystem from /dev/sdc2 on /home/games
Status Last Update Fields