Note: There is nothing that you must turn in associated with this exercise. If you do not finish the exercise during the lab session, it is to your benefit to finish it later on your own.
pwd, ls, mkdir, cd, cat, more,
less, rm, rmdir, mv
Follow the steps below in order. Notice that you are not always given the full command to use. As you move through the exercise, you are given fewer and fewer commands. It's time to think! Use your class notes as a reference.
linux1[110]% pwd /afs/umbc.edu/users/d/b/dblock/home linux1[111]%
linux1[111]% ls Mail bin www mybio.txt linux1[112]%
linux1[112]% ls -l total 6 drwx------ 2 dblock rpc 2048 Sep 19 09:04 Mail drwx------ 2 dblock rpc 2048 Sep 19 09:04 bin drwx------ 2 dblock rpc 2048 Sep 19 09:04 www drwx------ 2 dblock rpc 1024 Sep 19 09:04 mybio.txt linux1[113]%
linux1[120]% man ls linux1[121]%
linux1[121]% mkdir CS104 linux1[122]% ls CS104 Mail bin www linux1[123]%
linux1[123]% cd CS104 linux1[124]%
linux1[133]% mv ../mybio.txt Hw1 linux1[134]% ls .. CS104 Mail bin www linux1[135]% ls Hw1 mybio.txt linux1[136]%
pwd).
MyFiles. Verify
that the directory exists.
MyFiles directory. Verify
that you are there.
sam.txt.
linux1[138]% xemacs sam.txt linux1[139]%
I am Sam. Sam I am.
Do you like green eggs and ham?
Save the file and exit xemacs.
sam.txt file.
sam.txt on the monitor
(cat sam.txt OR more sam.txt OR
less sam.txt). To exit out of less, you should
type 'q'.
MyFiles directory. It
should contain only the file sam.txt.
MoreFiles.
Verify that it exists.
sam.txt from MyFiles
to MoreFiles.
linux1[140]% cp MyFiles/sam.txt MoreFiles
linux1[141]%
MoreFiles subdirectory.
It should now contain the file sam.txt.
MyFiles subdirectory. You will get a
message that the directory is not empty. You must delete all files and
subdirectories from a directory before deleting the directory itself.
So,
sam.txt from MyFiles.
MyFiles to make sure
that it is empty.
MyFiles subdirectory.
MyFiles has been deleted.
linux1[143]% rmdir MyFiles/
rmdir: `MyFiles/': Directory not empty
linux1[144]% rm MyFiles/sam.txt
rm: remove regular file `MyFiles/sam.txt'? y
linux1[145]% ls MyFiles/
linux1[146]% rmdir MyFiles
linux1[147]% ls
CS104 Mail MoreFiles bin www
linux1[148]%
sam.txt from the MoreFiles directory
to your current (home) directory.
linux1[156]% mv MoreFiles/sam.txt . linux1[157]% ls CS104 Mail MoreFiles bin sam.txt www linux1[158]%
sam.txt is there.
MoreFiles to be sure that sam.txt is no longer there.
MoreFiles subdirectory.
sam.txt.
Be sure to logout completely when you have finished!