Name: Date Performed:
LINUX LAB 2
1. To identify and describe your method of connecting to a LINUX system.
2. To practice using file maintenance commands.
3. To practice building the directory and file structure.
4. To further examine man pages and aliases for maintenance commands.
Lab Work (2 points)
Please each time show your session if it is possible.
Please answer to each exercise and hand in printouts and a USB flash drive/CD-ROM to the
instructor. Each time show your session (commands and results) related to the specific question by
copying the result into your word document. Highlight differently the commands and outputs.
1. Log on to your LINUX system. Make an exact list of exactly what steps you employ when
logging-into and out of your LINUX system, and in the list, describe each step briefly in a
sentence or two.
2. After you have successfully logged-in using your method from above, in the console or terminal
window, type the following LINUX commands on the command line. Note and write down the
results (The command line prompt is shown as a $, which may be different on your system):
a. $ ls
b. $ pwd
c. $ xy
d. $ cd ..
e. $ pwd
g. $ cd /usr/local
i. $ ls
j. $ cd
3. Use the man command on your LINUX system to construct a table of one sentence long
descriptions for all ten (10) file maintenance commands found the lecture notes (textbook). Put the
Description part of the manual page that you see displayed on-screen into your own words in one-
sentence format, being careful to include the most important aspect(s) of the command as you find
them stated in the description.
4. Create a text file named "manual_mkdir" of the contents of the man page for the command mkdir
by typing the following command on the LINUX command line:
man mkdir > manual_mkdir. This command is similar to what is shown in the lecture
notes (textbook), and is an example of output redirection; the > character redirects the output of
the manual page from the man command to a file, which you have specified as manual_mkdir.
Display the file and report here only 1st 5 lines.
5. How many users are logged onto your system at this time? What command did you use?
6. Determine the name of the operating system that your computer runs. What command did you use
to find out?
7. Give the command line for displaying manual pages for the “socket”,” read”, and “connect
8. Use switches, such as –1, -x, -C, -b, -?, -r, -R, -m, -i, -l, -a with ls command, and observe how the
lists change. For example,
ls -1 [ENTER]
Describe (don’t copy the results) the effect of each switch. You can use the man ls command to help
you answer this question.
9. It is not required. Depending upon the default shell that you run when you login to your LINUX
system, create 6 command aliases similar to found in LN_Linux_Getting_Started.ppt, for your use
whenever you login. Specify your list of 6 here for at least two shells.
10. In preparation for the following steps, create two (2) text files in your home directory on your
LINUX system named 1st and 2nd, by using the cat command (see
11. Part I. You may type whatever text you want into these files, as long as it consists of printable
characters that can be viewed on the LINUX command line. Also, after executing the following
steps for each figure, if you delete files 1st and 2nd by mistake, then recreate them before you go
on to the next figure.
Using the figures found below, and the file maintenance commands covered in the lecture
notes/textbook, create a directory and file structure under your home directory on your LINUX
system exactly as shown in each figure. A directory is represented in the figures as a rectangle,
and a file is represented as a circle.
Then, write down a list of exactly what commands you used in sequence to create the
structure for each figure. The directories and files that already exist in your home directory before
you begin are irrelevant for our purposes in these exercises. In the event that directories that
already exist in your home directory before you start any exercise have the same exact names as
any of those shown in the figures below, then simply make up your own names for what is shown
in the figures, and create the structure using your own names.
Tip1: shorten the number of commands (e.g. by putting more than one argument for the same
command) they used above to create and undo the file structures.
Tip2: You can always use the pwd and ls commands at any point in the construction process to
verify the fidelity of your structure.
Being at your home directory verify your structure using ls -RC.
Part II. .Once you have finished building each structure, use the appropriate file maintenance
commands from the lecture notes (textbook) to completely undo what you have done above.
Then write down a list of exactly what commands you used in sequence to undo the structure
for each figure. "Undo" means delete the directories and files created for that figure, except for
files 1st and 2nd. The files 1st and 2nd must remain in your home directory after you have undone
the directory and file structure for any particular figure, so that you can use them to create the
structure for the
12. Log out.
Press <Ctrl-D> to exit.