Вы находитесь на странице: 1из 5

Meaning/Action bash (Bourne Shell) csh (C-Shell)

Default user $ %
prompt
Force redirection >| >!
Redirect stdout and &> file or > file 2>&1 >& file
stderr to file
Expand elements {} {}
in list
Substitute output `command` or $(command) `command`
of enclosed
command
Home directory $HOME $home
Home directory ~ ~
symbol
Access directory ~+, ~-, dirs =-, =N
stack
Variable VAR=value set var=value
assignment
Set environment export VAR=value setenv var val
variable
More than 9 ${nnnn}
arguments can be
referenced
All arguments as "$@"
separate words
Number of $# $#argv
arguments
Exit status of the $? $status
most recently
executed command

PID of most $!
recently
backgrounded
process
Current options $-
Read commands in source file or . file source file
file
Name x stands for alias x='y' alias x y
command y
Choose case switch or case
alternatives
End a loop done end
statement
End case or switch esac endsw
Exit with a status exit n exit (expr)
Loop through for/do foreach
variables
Ignore substitution set -f, set -o noglob
characters for nullglob|dotglob|nocaseglob|noglob
filename
generation
Display hashed hash hashstat
commands
(tracked aliases)
Remember hash cmds rehash
command locations
Forget command hash -r unhash
locations
List previous history history
commands
Redo previous ArrowUp+Enter or !! !!
command
Redo last !str !str
command that
starts with "str"
Replace "x" with !cmd:s/x/y/ !cmd:s/x/y/
"y" in most recent
command starting
with "cmd", then
execute.
Sample condition if [ $i -eq 5 ] if ($i==5)
test
End if statement fi endif
Set resource limits ulimit limit
Print working pwd dirs
directory
Read from terminal read $<
Ignore interrupts trap 2 onintr
Remove aliases unalias unalias
Begin while loop while/do While

Вам также может понравиться