• Home
  • Textbooks
  • Practical Guide to Fedora and Red Hat Enterprise Linux, A
  • The Linux Filesystem

Practical Guide to Fedora and Red Hat Enterprise Linux, A

Mark G. Sobell

Chapter 6

The Linux Filesystem - all with Video Answers

Educators


Chapter Questions

01:45

Problem 1

Is each of the following an absolute pathname, a relative pathname, or a simple filename?
a. milk_co
b. correspond/business/milk_co
c. /home/max
d. /home/max/literature/promo
e. ..
f. letter. 0210

Foster Wisusik
Foster Wisusik
Numerade Educator

Problem 2

List the commands you can use to perform these operations:
a. Make your home directory the working directory
b. Identify the working directory

Check back soon!

Problem 3

If the working directory is /home/max with a subdirectory named literature, give three sets of commands you can use to create a subdirectory named classics under literature. Also give several sets of commands you can use to remove the classics directory and its contents.

Check back soon!

Problem 4

The df utility displays all mounted filesystems along with information about each. Use the df utility with the -h (humanreadable) option to answer the following questions.
a. How many filesystems are mounted on your Linux system?
b. Which filesystem stores your home directory?
c. Assuming your answer to exercise $4 \mathrm{a}$ is two or more, attempt to create a hard link to a file on another filesystem. What error message do you get? What happens when you attempt to create a symbolic link to the file instead?

Check back soon!

Problem 5

Suppose you have a file that is linked to a file owned by another user. How can you ensure that changes to the file are no longer shared?

Check back soon!

Problem 6

You should have read permission for the /etc/passwd file. To answer the following questions, use cat or less to display /etc/passwd. Look at the fields of information in /etc/passwd for the users on the local system.
a. Which character is used to separate fields in /etc/passwd?
b. How many fields are used to describe each user?
c. How many users are on the local system?
d. How many different login shells are in use on your system? (Hint: Look at the last field.)
e. The second field of /etc/passwd stores user passwords in encoded form. If the password field contains an $\mathbf{x}$, your system uses shadow passwords and stores the encoded passwords elsewhere. Does your system use shadow passwords?

Check back soon!

Problem 7

If /home/zach/draft and /home/max/letter are links to the same file and the following sequence of events occurs, what will be the date in the opening of the letter?
a. Max gives the command vim letter.
b. Zach gives the command vim draft.
c. Zach changes the date in the opening of the letter to January 31 , writes the file, and exits from vim.
d. Max changes the date to February 1, writes the file, and exits from vim.

Check back soon!

Problem 8

Suppose a user belongs to a group that has all permissions on a file named jobs_list, but the user, as the owner of the file, has no permissions. Describe which operations, if any, the user/owner can perform on jobs_list. Which command can the user/owner give that will grant the user/owner all permissions on the file?

Check back soon!

Problem 9

Does the root directory have any subdirectories you cannot search as an ordinary user? Does the root directory have any subdirectories you cannot read as a regular user? Explain.

Check back soon!

Problem 10

Assume you are given the directory structure shown in Eigure 6-2 on page 177 and the following directory permissions:
Click here to view code image
d--x--x--- 3 zach pubs 512 2010-03-10
$15: 16$ business
drwxr-xr-x 2 zach pubs 512 2010-03-10
15:16 business/milk_co
For each category of permissions-owner, group, and other-what happens when you run each of the following commands? Assume the working directory is the parent of correspond and that the file cheese_co is readable by everyone.
a. cd correspond/business/milk_co
b. Is -l correspond/business
c. cat correspond/business/cheese_co

Check back soon!

Problem 11

What is an inode? What happens to the inode when you move a file within a filesystem?

Check back soon!

Problem 12

What does the .. entry in a directory point to? What does this entry point to in the root (/) directory?

Check back soon!

Problem 13

How can you create a file named -i? Which techniques do not work, and why do they not work? How can you remove the file named -i?

Check back soon!

Problem 14

Suppose the working directory contains a single file named andor. What error message do you get when you run the following command line?
$$\$ $$mV andor and $$\backslash /$$ or
Under what circumstances is it possible to run the command without producing an error?

Check back soon!
02:49

Problem 15

The Is -i command displays a filename preceded by the inode number of the file (page 206). Write a command to output inode/filename pairs for the files in the working directory, sorted by inode number.

Clarissa Noh
Clarissa Noh
Numerade Educator

Problem 16

Do you think the system administrator has access to a program that can decode user passwords? Why or why not? (See exercise 6.)

Check back soon!

Problem 17

Is it possible to distinguish a file from a hard link to a file? That is, given a filename, can you tell whether it was created using an In command? Explain.

Check back soon!
01:17

Problem 18

Explain the error messages displayed in the following sequence of commands:
Click here to view code image
$$\$ 1 s-1$$
total 1
drwxrwxr-x. 2 max pubs 1024 03-02 17:57
dirtmp
$$\$ $$1s dirtmp
$$\$ $$rmdir dirtmp
rmdir: dirtmp: Directory not empty
$$\$ $$rm dirtmp/*
rm: No match.

Vysakh M
Vysakh M
Numerade Educator