cd
cd it244
cd ex
mkdir ex4
cd ex4
mkdir abc&def
You should get an error message
ls
mkdir
created an abc directory
and then tried to execute the non-existent command def
rmdir abc
ls
echo foo \[Enter] bar [Enter]Do not type [Enter].
pwdIf the result of running this command is not
/home/YOUR_UNIX_USERNAME/it244/ex/ex4where YOUR_UNIX_USERNAME is the name of your Unix account, see me.
script
commandscriptThis will create a typescript file in your ex4 directory.
script
is still running.
script
session until you have finished all the steps in this exercise.
ls
cd
pwd
ls
without options or arguments
lsYou see only the visible files in your home directory.
ls it244
ls -a
ls -alNotice that you can use more than one option at a time.
cat
cat
on your .bash_history file
cat .bash_history
cat -n .bash_history
mkdir
cd it244/ex/ex4 pwd
mkdir test
ls
mkdir test2
lsYou should see the a new test2 directory.
rm
cd test2
touch foo bar bletch gobble
touch
will create a file if it doesn't already exist.
ls -lThe first entry after -rw-r--r-- for each file is a 1. This means the files are one byte long, essentially empty.
touch
creates empty files.
rm foo
ls
rm bar bletch
lsYou should only see the file gobble.
rm -i gobbleEnter "y" when prompted.
lsThe directory should be empty.
touch baloney ham cheese turkey
lsYou should see the files you just created.
rm *
lsThe directory should be empty.
rmdir
pwdIf not, go there.
touch red blue green orange
cd ..
pwd
ls test2
rmdir
rmdir test2You should get an error message because the directory is not empty.
lsThe test2 directory is still there.
rm test2/*
ls test2The directory should be empty.
rmdir test2
lsThe test2 directory should be gone
cp
to Copy Files and Directoriestouch foo
cp foo footoyou
ls
cd test
touch foo bar bletch
cd ..
pwd
cp -r test test3
lsYou should see a new test3 directory.
ls test3It should be the same as test
mv
cd test3
mv foo foo_to_you
ls
mv foo_to_you ../test
lsfoo_to_you is no longer in your current directory.
ls ../testfoo_to_you has been moved to the test directory.
script
Sessionscript
sessionexitYou need to do this or the typescript file will never be created.
cat typescript
~ghoffman/it244_test/ex04.shThe script will prompt you for your Unix username.