Chapter 4 The Filesystem

25 July 2022
4.7 (114 reviews)
17 test answers

Unlock all answers in this set

Unlock answers (13)
question
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
answer
a. milk_co simple pathname b. correspond/business/milk_co c. relative pathname c. /home/max absolute pathname d. /home/max/literature/promo absolute pathname e. etter.0210 simple filename.
question
List the commands you can use to perform these operations: a. Make your home directory the working directory b. Identify the working directory
answer
a. cd b. pwd
question
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.
answer
To make a subdirectory in max you would ~/literature, to make a subdirectory in literature you could mkdir literature/promo with a relative pathname or mkdir /home/mac/literature/promo with an absolute pathname. To do both at once use mkdir -p literature/promo or mkdir -p literature/promo
question
The df utility displays all mounted filesystems along with information about each. Use the df utility with the -h (human readable) option to answer the following questions. a. How many filesystems are mounted on the local system? b. Which filesystem stores your home directory? c. Assuming your answer to exercise 4a is two or more, attempt to create a hard link to a file on another filesystem. What error message is displayed? What happens when you attempt to create a symbolic link to the file instead?
answer
a. How many filesystems are mounted on the local system. idk b. idk c. ln -f file1 file2. It didn't send an error message it just brought file over from one file to another. For a sym link ls -s path/to/file path/to/symlink ls -sf path/to/file path/to/symlink to update the symlink
question
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?
answer
You can use permissions to change who can read, write and execute the file.
question
SHOULD RE-ADDRESS THIS ONE [You should have read permission for the /ext/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 desribe each user?]
answer
a. They seem to be separated with _. b. One field per user? c. Not sure d. eh e.maybe
question
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 file.
answer
$ chmod u+rwx jobs_list
question
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?
answer
Yes, there are root privileges that non root privilege people don't have
question
For each category what happens when you run each of the following commands: a. cd correspond/business/milk_co b. ls -l correspond/business c. cat correspond/business/cheese_co
answer
a. When you run cd to milk_co the user can go there and the group and own can go but can't write. b. For business neither the user, group or own can read, write or execute. c. Everyone can read cheese_co
question
What is an inode? What happens to the inode when you move a file within a system?
answer
The inode is a data structure in a Unix-style file system that describes a filesystem object such as a file or a directory. Each inode stores the attributes and disk block location(s) of the object's data. ... A directory contains an entry for itself, its parent, and each of its children. The inode is updated with the new location of the file.
question
What does the .. entry in a directory point to? What does this entry point to in the root / directory?
answer
The .. entry is a link to the parent directory. In the case of the root directory, there is no parent, so the .. entry is a link to the root directory itself.
question
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?
answer
You can't create a file named -i because ls -i file_a file_b file_c is used to find out which files are linked.
question
Suppose the working directory contains a single file named andor. What error message is displayed when you run the following command line $ mv andor and/or Under what circumstances is it possible to run the command without producing error?
answer
It says rename andor to and/or: There's no such file or directory. The circumstance would be that the file/directory would have to exist.
question
The ls -i command displays a filename preceded by the inode number of the file. Write a command to output inode filename pairs for the files in the working directory, sorted by inode number. (Hint: use a pipeline. )
answer
idk right now
question
Do you think the system administrator has access to a program that can decode user passwords? Why or why not?
answer
Normally, the system administrator cannot decode user passwords. The administrator can assign a new password to a user. Passwords are generally encrypted by a one-way hash so that the system can tell when the correct password is entered, but it cannot regenerate the cleartext password. Fundamentally the system applies the hash algorithm to the entered password and checks whether the result matches the stored, encrypted password. A match means the correct password was entered. However, if a user has a weak password, the system administrator can use a program such as crack or John the ripper to decode a password. You can download either of these utilities using yum. The packages are named crack and john.
question
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 ln command?
answer
idk
question
Explain the error messages displayed in the following sequence of commands:
answer
There is a file whose name begins with a period (a hidden file) in the dirtmp directory. Use ls with the -a option to list the file. Remove the file, and then you will be able to remove the directory.