The goal of this lab is to become proficient with system commands
for viewing the directories and different file types that make up a Unix
If you get stuck, have a question or want to share something you learned with this lab then use the CIS 90 Forum at
Log on to the Opus server so that you have a command line shell at your
service. Be sure you are in your home directory to start this lab.
The questions asked in the first list of 17 steps are to check your
understanding of that particular step. You do not need to record these
- Display a listing of the files in your home directory. Are they in any
- Use ls -a to display the contents of directory Lab2.0
Which filenames do not follow the Unix file naming conventions?
- Use ls -F to determine what kind of files you have in your home directory.
Do all directories begin with an uppercase letter?
- Use the file command to analyze the following files: Poems, proposal2,
timecal, and empty.
- Display the contents of the mission file on your screen.
- Display the contents of the letter file on your screen.
Is it more appropriate to use cat or more?
- List the filenames stored under the root (/) directory. Are these files or
subdirectories or both?
- Determine the absolute pathname of your home directory. Use this pathname as
an argument to the ls command. What are two other ways of getting the same
- List the contents of your Poems directory using a relative pathname.
Do the same thing using an absolute pathname, i.e. beginning with a slash (/)
- Display the contents of the jerusalem file stored under the Blake
directory, which is under the Poems directory.
- Use a single more or less command to browse each of the files
stored under the Yeats subdirectory. Why did you choose the command you
used? How can you tell where one file ends and the next begins?
- Use the head and tail commands to look at the top and bottom
ten lines of bigfile.
- Use the ls command to see what is stored in the /bin directory.
Do you recognize any of the filenames? What kind of files are these?
- Display the contents of the file what_am_i. Which command did you use?
- Use ls -lia to do a long listing of the files in the Miscellaneous directory.
- Use ls -lid to do a long listing of the Miscellaneous directory itself.
- Use wc on some of the sonnets in the Shakespeare directory. Use man wc
to understand the results or try different options. Is the operation of the man page similar
to the more or less command?
To turn in for grading, answer the following questions. Record your
answers in a text file, one answer per line. When you are done,
copy your answers and paste them into a mail message to:
with a subject of CIS 90 Lab 4
Note, we have not learned about UNIX text editors yet so you may use your favorite text tool on Windows or Mac to record your answers. If you use your regular non-Opus email, send you answers as part of the message and NOT as an attachment. If you send your answers using /bin/mail on Opus (as in Lab 3) then you will earn some extra credit!
- Write down the absolute path of your home directory.
- Relative to your home directory, what is the pathname of the tiger
file in the Blake subdirectory?
- What command allows you to see hidden files in your current directory?
- What command shows the pathname of your current working directory?
- Are any of your hidden files directories? If so, which ones?
- What does the cd command do when it is invoked with no arguments?
- Assuming you are in your home directory, what command will change your current
working directory to the directory that holds Shakespeare's sonnets?
- What is the inode number of the /home/cis90ol directory?
- Who is the owner of your home directory?
- What's the name of the largest text file in your home directory?
- What's the name and size of the smallest file in your home directory?
- How many subdirectories does the Poems directory have?
- What is the first line of the file old in the Poems/Yeats
- What is the last line of sonnet3 in the Shakespeare directory?
- What are the filename(s) of file(s) in your home directory that you should you not view with the cat
or more commands?
- What key should you type when you want to exit from the more command?
- What ls command-line allows you to see the permissions of your home
directory while you are in your home directory?
- What Unix command will allow you to look at the contents of a data (binary) file?
- From your home directory what is the relative path to sonnet1?
- Which file in /boot/grub has inode number 12051?
- What command will set your prompt to show your current working directory path and a $?
- How many lines are in Shakespeare's sonnet1?
- What English word do you see between hex offset 00000f0 and 0000100 of the file what_am_i?
- What file in the Miscellaneous directory is a symbolic link to another file?
- What is the inode number of the file being linked to?
Bonus question (extra credit): With what command can you list only the hidden files (and nothing else) of your home directory?
Grading Rubric (30 points total)
1 point for each correct answer to questions 1 to 20.
2 points for each correct answer to questions 21 to 25.
5 points extra credit for answering the bonus question above correctly
5 points extra credit for using /bin/mail on Opus to email your answers