cd ~/it244/ex
mkdir ex15
bash Startup Files
cd
pwd
ls .bash*
Unless you have created .bashrc
or .bash_profile, you should see only
.bash_history.
nano .bash_profile
ex=~/it244/ex
There 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 .bashrc
Notice that this is a different file than .bash_profile.
PS1='--> '
Again, there must be no spaces on either side of the =.
nano
bash
Notice that your prompt has changed.
ps
The first bash process is your login shell.
exit
Notice that your prompt now has returned to normal.
ps again
ps
You have only one bash process running.
ls
which ls
You 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/ex15
pwd
~tsoro/course_files/it244_files/make_foo.sh
This 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?.txt
Notice that foo.txt and
the files
foo10.txt through foo29.txt
do not appear in the listing.
ls -l foo2?.txt
Notice that you only print the files foo20.txt
to foo29.txt
ls -l foo??.txt
Notice 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/ex15
nano ex15.sh
chmod 755 ex15.sh
./ex15.sh > /dev/null
Running ex15.sh this way
will only print error messages.
~tsoro/it244_test/ex15.sh
When the script asks if you are ready for more, hit Return or Enter.