OS Lab 2 - Workshop2
OS Lab 2 - Workshop2
cat /etc/shells
– Executing programs
– Evaluating special characters, e.g. *
– Managing pipes, redirection, signals, and background
processes
• As a user, you can customise your own shell using one of the
hidden configuration files in your home directory, for
example, ~/.profile
!emacs r
• To avoid this, you can tell the shell to run any program such
as emacs as a background process using the ampersand sign &
emacs&
PTA Linux Series
• If you cannot run a program, you can echo the PATH variable
as a check, for example:
echo $PATH
PTA Linux Series
export PATH=$PATH:/my/cpp/programs:
alias e=emacs
alias emcas=emacs
export http_proxy=http://student-proxy.ul.ie
• You will need to put this line into your shell configuration file
to make it more permanent, e.g. ~/.profile
echo $http_proxy
grep password *
PTA Linux Series
• ^ : Beginning of line
• $ : End of line
follows:
ls | more
• The output of the command on the left becomes the input for
the command on the right hand side
ls > logfile
ls >> logfile
• Input can be taken from sources using the opposite arrow, e.g.
export PS1=“>”
export PS1=“\e[37;44m\u\t\w$”
PTA Linux Series
Now, search for a line beginning with “apples”
Search for any line which contains the letters “ea”
Search for a line ending with “s”