cd ~/it244/ex
mkdir ex16
bash
Startup Filescd
pwd
ls -a .bash*You should at least see .bash_history.
nano .bash_profile
ex=~/it244/exThere must not be any spaces on either side of the =.
nano
echo $ex
echo
prints a blank line, because .bash_profile ran when you first logged in.
source .bash_profile
echo $ex
cd $ex
pwd
cd
nano .bashrcNotice that this is a different file than .bash_profile.
PS1='--> 'Again, there must be no spaces on either side of the =.
nano
bashNotice that your prompt has changed.
psThe first
bash
process is your login shell.
exitNotice that your prompt now has returned to normal.
ps
againpsYou have only one
bash
process running.
ls
which lsYou get an absolute pathname, so
ls
is not a built-in.
cat
which cat
cat
is also not a built-in.
bg
which bg
which
returns nothing because bg
is a built-in command.
fg
which fg
fg
is also a built-in command.
cd
cd it244/ex/ex16
pwd
~ghoffman/course_files/it244_files/make_foo.shThis script will create some files that you will use in the remainder of this exercise.
ls -l
ls -l f*You only have to enter as many characters as are needed to distinguish the files you want from the files you don't want.
ls -l foo1*.txt
ls -l f*2*You can use multiple instances of metacharacters.
ls -l foo?.txtNotice that foo.txt and the files foo10.txt through foo29.txt do not appear in the listing.
ls -l foo2?.txtNotice that you only print the files foo20.txt to foo29.txt
ls -l foo??.txtNotice that you now you see the files foo10.txt to foo29.txt
ls -l foo[123].txt
ls -l foo[1-5].txt
ls -l foo[1-46-9].txt
ls -l foo[!05].txt
ls -l foo1[456].txt
ls -l foo1[6-9].txt
ls -l foo2[1-46-9].txt
ls -l foo2[!50].txt
ls -l foo[123].*
ls -l f??[123].txt
ls -l f??[123].*
cd ~/it244/ex/ex16
nano ex16.sh
chmod 755 ex16.sh
./ex16.sh > /dev/nullRunning ex16.sh this way will only print error messages.
~ghoffman/it244_test/ex16.shWhen the script asks if you are ready for more, hit Return or Enter.