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].
pwd
If the result of running this command is not
/home/YOUR_UNIX_USERNAME/it244/ex/ex4
where YOUR_UNIX_USERNAME is the name of your Unix account, see me.
script command
script
This 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
ls
You see only the visible files in your home directory.
ls it244
ls -a
ls -al
Notice that you can use more than one option at a time.
catcat on your .bash_history file
cat .bash_history
cat -n .bash_history
mkdir
cd it244/ex/ex4
pwd
mkdir test
ls
mkdir test2
ls
You 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 -l
The 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
ls
You should only see the file gobble.
rm -i gobble
Enter "y" when prompted.
lsThe directory should be empty.
touch baloney ham cheese turkey
ls
You should see the files you just created.
rm *
ls
The directory should be empty.
rmdir
pwd
If not, go there.
touch red blue green orange
cd ..
pwd
ls test2
rmdir
rmdir test2
You should get an error message because the directory is not empty.
ls
The test2 directory is still there.
rm test2/*
ls test2The directory should be empty.
rmdir test2
ls
The test2 directory should be gonecp to Copy Files and Directories
touch foo
cp foo footoyou
ls
cd test
touch foo bar bletch
cd ..
pwd
cp -r test test3
ls
You should see a new test3 directory.
ls test3
It should be the same as test
mv
cd test3
mv foo foo_to_you
ls
mv foo_to_you ../test
ls
foo_to_you is no longer in your current directory.
ls ../test
foo_to_you has been moved to the test directory.
script Sessionscript session
exit
You need to do this or the typescript file will never be created.
cat typescript