cat /proc/cpuinfo | grep cpu
Every channel has a le descriptor: 0 (zero) for standard input, 1 for standard output
and 2 for standard error. It is allowed to insert this le descriptor before a < or >
character. For example, the following line searches for a le starting with foo, but
suppresses its errors by redirecting it to /dev/null:
find / -name "foo*" 2>/dev/null
18.4 Using Aliases
An alias is a shortcut denition of one or more commands. The syntax for an alias
is:
alias
NAME
=
DEFINITION
For example, the following line denes an alias lt which outputs a long listing (option
-l), sorts it by modication time (-t) and prints it in reverse order while sorting (-r):
alias lt='ls -ltr'
To view all alias denitions, use alias. Remove your alias with unalias and the cor-
responding alias name.
18.5 Using Variables in Bash
A shell variable can be global or local. Global variables, or environment variables,
can be accessed in all shells. In contrast, local variables are visible in the current
shell only.
To view all environment variables, use the printenv command. If you need to know
the value of a variable, insert the name of your variable as an argument:
printenv PATH
A variable, be it global or local, can also be viewed with echo:
echo $PATH
To set a local variable, use a variable name followed by the equal sign, followed by
the value:
PROJECT="SLED"
Do not insert spaces around the equal sign, otherwise you get an error. To set an
environment variable, use export:
export NAME="tux"
To remove a variable, use unset:
230 Start-Up