Lab04: The Unix File System
Objectives
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
filesystem.
Procedure
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: jimg.opus@cabrillo.edu
I will confirm that I have received it.
- Write down the absolute path of your home directory.
/home/cis90/guest (This would be guest's answer.)
- Relative to your home directory, what is the pathname of the tiger
file in the Blake subdirectory?
Poems/Blake/tiger
- What command allows you to see hidden files in your current directory?
ls -a
- What command shows the pathname of your current working directory?
pwd
- Are any of your hidden files directories?
Yes, at least . and .. and maybe .ssh
- What does the cd command do when it is invoked with no arguments?
It makes $HOME your current working directory
- Assuming you are in your home directory, what command will change your
current working directory to the directory that holds Shakespeare's sonnets?
cd Poems/Shakespeare or
cd /home/cis90/guest/Poems/Shakespeare
- What is the inode number of the /home/cis90 directory?
87745
- Who is the owner of your home directory?
You are, $LOGNAME
- What's the name of the largest text file in your home directory?
bigfile (or possibly mbox)
- What's the name and size of the smallest file in your home directory?
empty 0 bytes
- How many subdirectories does the Poems directory have?
Three: Blake, Yeats, Shakespeare
- What is the first line of the file old in the Poems/Yeats
directory?
When you are old and grey and full of sleep,
- What is the last line of sonnet3 in the Shakespeare directory?
Die single, and thine image dies with thee.
- Which files in you home directory should you not view with the cat
or more commands?
Any of your subdirectories, and what_am_i
- What key should you type when you want to exit from the more command?
q
- What ls command-line allows you to see the permissions of your home directory, if you are in your home directory?
ls -ld $HOME
- What Unix command will allow you to look at the contents of a data file.
xxd
- Extra Credit: With what command can you list all the hidden files, and
only the hidden files of your home directory?
ls -d .* or
echo .*