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% pwd /afs/umbc.edu/users/d/b/dblock/home linux1%
linux1% ls Mail bin www mybio.txt linux1%
ls, but with more information about each. Note that it is -l (the letter l, not the number 1).
linux1% ls -l total 6 drwx------ 2 dblock rpc 2048 Sep 19 09:04 Mail drwx------ 2 dblock rpc 2048 Sep 19 09:04 bin lrwx------ 2 dblock rpc 2048 Sep 19 09:04 www -> ../pub/www -rw------- 2 dblock rpc 1024 Sep 19 09:04 mybio.txt linux1%
man ls). Look for the option that will show "all" files including those that are hidden (files starting with a period). To exit out of the man page, you should type 'q' for quit.
linux1% pwd /afs/umbc.edu/users/d/b/dblock/home/ linux1% cd .. linux1% ls Mail backup home pub linux1%
linux1% pwd /afs/umbc.edu/users/d/b/dblock/ linux1% ls Mail backup home pub linux1% cd pub linux1% ls www linux1%
linux1% cd www linux1% mkdir cs104 linux1% ls cs104 linux1%
Personal. Verify that the directory exists.
Personaldirectory. Verify that you are there.
linux1% xemacs things2do.txt linux1%
1. Finish today's lab exercise.
2. Eat dinner.
Save the file and exit xemacs. In case you forgot how to save, it's ctrl-x ctrl-c and then press 'y' for yes.
things2do.txton the monitor (
less things2do.txt). To exit out of less, you should type 'q'.
ls Personal). It should contain only the file
PersonalBackupin your home directory. Verify that it exists. Both Personal and PersonalBackup should be in your home directory.
linux1% pwd /afs/umbc.edu/users/d/b/dblock/home/ linux1% mkdir PersonalBackup linux1% ls Mail bin www Personal PersonalBackup linux1%
linux1% cp Personal/things2do.txt PersonalBackup linux1%
PersonalBackupsubdirectory. It should now contain the file
Personalsubdirectory. 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,
Personalto make sure that it is empty.
Personalhas been deleted.
linux1% rmdir Personal/ rmdir: `Personal/': Directory not empty linux1% rm Personal/things2do.txt rm: remove regular file `Personal/things2do.txt'? y linux1% ls Personal/ linux1% rmdir Personal linux1% ls Mail PersonalBackup bin www linux1%
PersonalBackupdirectory to your current (home) directory.
linux1% mv PersonalBackup/things2do.txt . linux1% ls Mail PersonalBackup bin things2do.txt www linux1%
PersonalBackupto be sure that
things2do.txtis no longer there.
If you do not complete the lab today and would like to finish later, you can continue to work on it from home.
Be sure to logout completely when you have finished!