| ctrl + u | Clear everything before the cursor |
| ctrl + a | To beginning of line |
| ctrl + e | To end of line |
| ctrl + f | Forward one character |
| ctrl + b | Back one character |
| ctrl + w | Cut last word |
| ctrl + k | Clear everything after cursor |
| ctrl + _ | Undo |
| meta + f | Forward one word |
| meta + b | Back one word |
| > | send output to file (overwriting and destroying whatever is in the file already) |
$ echo "Write output to file" > example.txt | |
| >> | append output to file |
$ echo "Append this to file" >> example.txt | |
| < | take input from file |
$ cowsay < example.txt | |
| 2> | send error messages to file (overwriting). (This means that errors can be directed separately from normal output.) |
$ rm -vf folder1 file1 > out.txt 2> err.txt |
| \\ | escapes itself and other specials |
| \* | stands for anything (including nothing) |
$ find ex*.txt | |
| ? | stands for any single character |
$ find ex?mple.txt | |
| [] | encloses patterns for matching a single character |
$ find ex[abc]mple.txt | |
| () | runs the contents of the parentheses in a sub-shell |
| ; | terminates a command pipeline - use it to separate commands on a single line |
| '' | The contents of the single quotes are passed to the command without any interpretation. |
$ find '(echo abc)'* | |
| `` | The contents of the backquotes are run as a command and its output is used as part of this command |
$ echo \[uname](/man/uname)\`` | |
| "" | The contents of the quotes are treated as one argument; any specials inside the quotes, except for $ and \\, are left uninterpreted. |
$ cd "untitled folder" | |
| | | Pipes allow you to send the output of a command to another command. |
| & | Run a command in the background. |
$ cowsay & | |
| && | Only execute the second command if the first one was successful. |
| || | Only execute the second command if the first one was unsuccessful. |
| >> | These symbols are used for redirection. |
| !! | Repeat the last command |
$ sudo !! | |
| !* | Change the command, keep all arguments |
$ tail !* | |
| ^ | Quick history substitution, changing one string to another. |
| ^png^xcf^ | |
| # | Turns the line into a comment; the line is not processed in any way. |
| # hint text |
| Position | Meaning |
|---|---|
| 1 | File type: '-' for a regular file, 'd' for a directory, 'l' for a symbolic link. |
| 2-4 | Owner permissions (rwx) |
| 5-7 | Group permissions (rwx) |
| 8-10 | Other permissions (rwx) |
| u | Owner |
| g | Group |
| o | Other |
| r | Read |
| w | Write |
| x | Execute |
| Permission | Value |
|---|---|
| r | 4 |
| w | 2 |
| x | 1 |
| Field | Value |
|---|---|
| Minute | 0 - 59 |
| Hour | 0 - 23 |
| Day of month | 1 - 31 |
| Month | 1 - 12 |
| Day of week | 0 - 7 (0 and 7 are Sunday) |