!!
: Repeats the last command.!$
: Last word of the previous command.!^
: First argument of the previous command.!n
: Repeats the nth command in your history.!-n
: Repeats the command n places back in the history list.!string
: Executes the most recent command starting with 'string'.
{a,b,c}
: Expands intoa b c
(useful for manipulating multiple files).
~
: Home directory.~username
: Home directory ofusername
.
$variable
: Value ofvariable
.${variable}
: Same as above but useful for appending characters immediately after the variable without ambiguity.
$(command)
: Runscommand
and uses its output.`command`
: Older syntax for command substitution.
$((expression))
: Evaluates arithmetic expression and substitutes the result.
*
: Matches any characters.?
: Matches any single character.[abc]
: Matches any one character listed.
" "
: Double quotes (special characters except$
,\
, and backticks lose special meaning).' '
: Single quotes (everything is taken literally).
>
: Redirects output to a file, overwriting existing contents.>>
: Appends the output to the end of a file.<
: Takes input from a file.|
: Directs output of one command to another.