Bash Shell Flashcards
make a local variable
VAR1=variableAttributeHere
how do you make variable environmental variable?
export VAR1
VAR1 is the variable
delete environmental variable
unset VAR1
prevent inadvertent overwriting
set -o noclobber
to disable run:
set +o noclobber
when using this > operator
redirect standard error
find / -name core -print 2> /dev/null
redirect both standard and output error
ls /usr /cdr &> outerr.out
This example will produce a listing of the /usr directory and save the result in outerr.out. At the same time, it will generate an error message complaining about the non-existence of /cdr, and it will send it to the same file as well.
see all previously run commands
history
move cursor to beginning of command line
Ctrl a
home
erase the entire line
ctrl u
erase from the cursor to the end of the command line
ctrl k
move curse to the right by one word
alt f
move cursor to the left one word
alt b
display previous working directory
echo ~-
make an alias
alais rm=’rm -i’
list all hidden directories
ls -d .*