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
These are for the default emacs mode.There is also a [vim](/man/vim) mode:
Shell special characters are interpreted by the shell as soon as it is given the command. For example, if you type ls *.bak, the shell translates *.bak to the list of all files in the current folder whose names end in .bak. The ls command never sees the asterisk. So if you want to search for files which actually have an asterisk in their names, you have to escape the asterisk to stop the shell from interpreting it. \\ escapes itself and other specials
\* stands for anything (including nothing)
? stands for any single character
[] encloses patterns for matching a single character
$ find ex[abc]mple.txtcopy
() 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.
`` The contents of the backquotes are run as a command and its output is used as part of this command
$ echo \[uname](/man/uname)\``copy
"" The contents of the quotes are treated as one argument; any specials inside the quotes, except for $ and \,円 are left uninterpreted.
$ cd "untitled folder"copy
| Pipes allow you to send the output of a command to another command.
& Run a command in the background.
&& 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
!* Change the command, keep all arguments
^ 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
Don't confuse shell special characters with special characters in regular expressions. Regular expressions must be protected from the shell by enclosing them in single quotes.