UNIX / Linux
I'm compiling a list of what I consider to be the most useful shell commands and programs for Unix/GNU/Linux systems (i.e. POSIX-compliant systems). Later, I will explain what they do and give examples of their usage. There are already many similar pages online, but this will be more concise than most. Here are some examples of similar pages:www.tutorialspoint.com/unix/unix-basic-operators.htm
Here's a more comprehensive list:
Operators / Special symbols:
|.||Usage 1: A shortcut for the current working directory, synonomous with the command $(pwd)
Usage 2: Place at the beginning of a directory or file name to hide the directory or file.
Example 1: To execute the file "run.sh" located in the current active directory, simply issue the command
./run.shEample 2: To copy the file "text.pdf" from /home/username/Documents/ to the current working directory:
cp /home/username/Documents/text.pdf .Example 3: The file named .settings will be treated as a hidden file. Similarly, the directory named .config will be hidden.
|~||A shortcut for your home directory. If your username is "nathaniel", then ~ is equivalent to /home/nathaniel
Example: Running the command
cd ~/Desktopwill change the working directory to /home/nathaniel/Desktop Note: A file with a tilde as the last character in is name, for instance, a named thesis.tex~ will be treated as a hidden file by window mangers such as GNOME and KDE. It would generally be the backup version of the the document thesis.tex
|-||A shortcut for the previous directory. If you were in /home/username/directory and then you moved to /home/username/Desktop, then the command
cd -will take you back to the previous directory: /home/username/directory
|'text'||Single quotes are strong quotes; nothing inside of them is treated as syntax to be interpreted/expanded.
Example: If I issue the command
echo 'This command is a string. $SHELL and `whoami` will not be expanded'the output is:
This command is a string. $SHELL and `whoami` will not be expanded
|"text"||Double quotes are weak quotes; commands enclosed in backquotes `command string` or $(command string) and variables $VARIABLE will be replaced inside of double quotes.
Example: If I issue the command
echo "This command is a string. $SHELL and `whoami` will be expanded"the output is:
This command is a string. /bin/bash and nathaniel will be expanded
|<||command < input_file The file input_file will be fed into the program identified by the command|
|>||command > output_file The output if the command on the left will be sent to the file output_file rather than displaying in the terminal|
||||command1 | command2 Pipe output of command on the left into the input of the command on the right|
|>>||command >> output_file Append output of command to output_file rather than over-writing the file. Example|
|&||Issuing the command
command &causes the program launched by command to run in the background. The program will not exit when the shell is exited and the output of the program will not be visible in the shell.
|&&||command1 && command2 Run command2 if and only if command1 executes successfully Example:|
|;||Typing a semicolon in a command string is like pressing "enter"
command1; command2; command3;is equivalent to
|||||command1 || command2 Run command2 if and only if command1 does NOT execute successfully Example:|
Commands and Programs:
Some of these commands may be specific to the Bourne Again Shell (bash)help
find -name phrase
sshfs hostname: mountpoint
Image, video, PDF, and publishing tools
Ghostscript, TeX Live, ImageMagick, FFmpeg, pdftk.
Some utilities within these packages:
A very small sample of programs that are available for free:
Then there are programs that might not be extremely useful:
lynx - a text-based web browser
lpr - print a file from the command line
cal - a command line calendar