$ ls # ls is a command
$ /bin/ls # ls is a program in /bin
$ ./ls # ls can be run from a relative path
$ echo $PATH
/bin /sbin /usr/bin /usr/sbin [output varies per user]
When a command is run, the system checks these locations for them.
$ cmd1; cmd2 # do cmd1, then do cmd2
$ echo $? # echo the status of cmd2 ($? is the status if the last command)
$ cmd1 # do cmd1
$ echo $? # echo the exit status of cmd1
$ cmd1 && cmd2 # do cmd1, if cmd1 worked, do cmd2
{ ls; exit 0; }
$ cd /tmp && { ls; exit 0; }
$ cd /tmp && ( ls; exit 0 ) # run ls and exit in subshell
( ls; exit $? ) # exit subshell the same exit status of ls
$ $((5+3)) # do 5+3
$ echo $? # exit status is 0
$ $((3-3)) # do 3+3
$ echo $? # exit status is 1 (because result is zero)
$ if [[ cd /tmp ]]; then