pwd, ls, mkdir, cd, cat, more,
less, rm, rmdir, mv, emacs
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.
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.
linux1[2]% pwd /afs/umbc.edu/users/d/b/dblock/home linux1[3]%
linux1[4]% ls Mail bin www mybio.txt linux1[5]%
ls
, but with more information about each.
Note that it is -l (the letter l, not the number 1).
linux1[6]% 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[7]%
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.
Desktop
directory. Make sure you are in your home
directory before you start.Desktop
directory.
linux1[19]% pwd /afs/umbc.edu/users/d/b/dblock/home/ linux1[20]% cd Desktop linux1[21]% pwd /afs/umbc.edu/users/d/b/dblock/home/Desktop linux1[22]%
cs104
. Verify that it exists.
linux1[29]% mkdir cs104 linux1[30]% ls cs104 linux1[31]%
cs104
directory. (Make sure you are
there!) Create subdirectories called hw1, hw2, hw3, hw4, proj1,
proj2,
and proj3
. (Shortcut: Remember the up arrow
will repeat the last command. This might be helpful when creating the
subdirectories.) When you have finished verify that the subdirectories
exist.You will be using the emacs text editor to create a file called mybio.txt.
linux1[39]% cd hw1 linux1[40]% emacs mybio.txt
linux1[#]%
or
linux2[#]%
or linux3[#]%
prompt. mybio.txt
is in your
directory: ls
linux1[58]% ls mybio.txt
pwd
).
Personal
. Verify
that the directory exists.
Personal
directory. Verify
that you are there.
things2do.txt
.
linux1[32]% emacs things2do.txt linux1[33]%
1. Finish today's lab exercise.
2. Eat dinner.
Save the file and exit emacs.
things2do.txt
file.
things2do.txt
on the monitor
(cat things2do.txt
OR more things2do.txt
OR
less things2do.txt
). To exit out of less, you should
type 'q'.
Personal
directory (ls Personal
). It
should contain only the file things2do.txt
.
PersonalBackup
in your home directory. Verify that it exists.
Both Personal and PersonalBackup should be in your home directory.
linux1[34]% pwd /afs/umbc.edu/users/d/b/dblock/home/ linux1[35]% mkdir PersonalBackup linux1[36]% ls Mail bin www Personal PersonalBackup linux1[37]%
things2do.txt
from Personal
to PersonalBackup
.
linux1[38]% cp Personal/things2do.txt PersonalBackup linux1[39]%
PersonalBackup
subdirectory. It should now contain the file
things2do.txt
.Personal
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,
things2do.txt
from Personal
.
Personal
to make sure
that it is empty.
Personal
subdirectory.
Personal
has been deleted.
linux1[40]% rmdir Personal/ rmdir: `Personal/': Directory not empty linux1[41]% rm Personal/things2do.txt rm: remove regular file `Personal/things2do.txt'? y linux1[42]% ls Personal/ linux1[43]% rmdir Personal linux1[44]% ls Mail PersonalBackup bin www linux1[45]%
things2do.txt
from the PersonalBackup
directory
to your current (home) directory.
linux1[46]% mv PersonalBackup/things2do.txt . linux1[47]% ls Mail PersonalBackup bin things2do.txt www linux1[48]%
things2do.txt
is there.
PersonalBackup
to be sure that things2do.txt
is no longer there.
PersonalBackup
subdirectory.
things2do.txt
.
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!