1. About

1.1. Variables

Table 1.6. Variables

Command

Description

$PATH

path

$IFS

field separator

${varname:-}

default value for variable (if empty)

$0

program name

$1, $2, $3, ..., $n

arguments

$@

current command

$?

exit status from previous command

$PS1

prompt

1.2. Symbols

  • ` - tick mark

  • " - double quote

Table 1.7. Variables

Command

Description

!

#

$()

&&

&

'

*

+

,

-

:

;

<<

<=

<

>=

>>

>

@

[]

\\

|

||

~

1.3. Control Flow

Table 1.8. Control Flow

Command

Description

for ... do ... done

case ... esac

if ... then ... else ... fi

cat > ... << EOF ... EOF

while

until

set

unset

return

getopt

getopts

function

for

fi

false

true

expr

exec

eval

esac

else

elif

do

done

continue

case

break

1.4. Commands

Table 1.9. Shell Programming

Command

Type

Description

run-parts

run scripts or programs in a directory

seq

print a sequence of numbers

unalias

unset

uuidgen

create a new UUID value

xargs

build and execute command lines from standard input

type

trap

test

check file types and compare values

source

set +e

set -e

set

sleep

delay for a specified amount of time

sleep

sleep for a specified number of seconds

readonly

exit 0

exit 1

exit

terminate the calling process

exit

cause normal process termination

crontab

maintain crontab files for individual users (Vixie Cron)

crontab

tables for driving cron

cron

daemon to execute scheduled commands (Vixie Cron)

as

the portable GNU assembler.

alias

Creates user defined alias

awk

pattern scanning and processing language

basename

strip directory and suffix from filenames

basename

parse pathname components