Quiz: Chapter 04 Linux Filesystem Management

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Get a hint
Hint

A symbolic link is depicted by an @ symbol appearing at the beginning of the filename when viewed using the ls –l command.

a. True

b. False

Get a hint
Hint

b. False

A symbolic link is indicated by l (lowercase L) at the beginning of a long file listing.


Get a hint
Hint

What was created to define a standard directory structure and common file location for UNIX and Linux systems?

a. POSIX

b. X.500

c. FHS

d. OOBLA

Get a hint
Hint

c. FHS

The Filesystem Hierarchy Standard (FHS) is referenced by UNIX and Linux systems.


Card Sorting

1/19

Anonymous user
Anonymous user
encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards

A symbolic link is depicted by an @ symbol appearing at the beginning of the filename when viewed using the ls –l command.

a. True

b. False

b. False

A symbolic link is indicated by l (lowercase L) at the beginning of a long file listing.


2
New cards

What was created to define a standard directory structure and common file location for UNIX and Linux systems?

a. POSIX

b. X.500

c. FHS

d. OOBLA

c. FHS

The Filesystem Hierarchy Standard (FHS) is referenced by UNIX and Linux systems.


3
New cards

There is no real difference between the "S" and "s" special permissions when displayed using the ls –l command. One just means it is on a file, and the other means that it is on a directory.

a. True

b. False

b. False

The S special permission indicates that an underlying x permission has not been set, while the s special permission indicates that an underlying x permission has been set.

4
New cards

The default permissions given by the system prior to analyzing the umask are _____ for newly created directories and _____ for newly created files.

a. rw-rw-rw- and rw-rw-rw-

b. rw-rw-rw- and r--r--r--

c. rw-rw-rw- and rwxrwxrwx

d. rwxrwxrwx and rw-rw-rw-

d. rwxrwxrwx and rw-rw-rw-

The system assigns all permissions (rwxrwxrwx) to new directories, and all permissions except for execute (rw-rw-rw-) to new files.

5
New cards

What must a Fedora Linux user do to run cp or mv interactively and be asked whether to overwrite an existing file?

a. Just run cp or mv because they run in interactive mode by default.

b. Run interactive cp or interactive mv.

c. Run cp -i or mv -i.

d. Run cp –interactive or mv -interactive.

a. Just run cp or mv because they run in interactive mode by default.

On Fedora Linux systems, a default alias is configured to ensure that the cp and mv commands run their interactive counterparts: cp -i and mv -i, respectively.


6
New cards

he root user utilizes the chown command to give ownership of a file to another user. What must the root user do to regain ownership of the file?

a. Have the new owner run chgrp and list the root user as the new owner.

b. Run chgrp again listing the root user as the new owner.

c. Nothing, because this is a one-way, one-time action.

d. Run chown and list the root user as the new owner.

d. Run chown and list the root user as the new owner.

7
New cards

After typing the ls –F command, you see the following line in the output:

-rw-r-xr-- 1 user1 root 0 Apr 29 15:40 file1

How do you interpret the mode of file1?

a. User1 has read and write, members of the root group have read and execute, and all others have read permissions to the file.

b. Members of the root group have read and write, user1 has read and execute, and all others have read permissions to the file.

c. All users have read and write, members of the root group have read and execute, and user1 has read permissions to the file.

d. User1 has read and write, all others have read and execute, and members of the root group have read permissions to the file.

a. User1 has read and write, members of the root group have read and execute, and all others have read permissions to the file.

The first three permissions apply to the owner (user1), the second three permissions apply to members of the group owner (root), and the remaining permissions apply to everyone else.

8
New cards

Sure! Let's look at another example:

drwxr-xr--

Here's the breakdown:

File Type:

d: This is a directory.

Permissions:

Owner: rwx (read, write, and execute permissions)

Group: r-x (read and execute permissions)

Others: r-- (read-only permission)

So, in this example:

The owner can read, write, and execute.

The group can read and execute.

Others can only read.

9
New cards

After typing the command umask 731, the permissions on all subsequently created files and directories will be affected. In this case, what will be the permissions on all new files?

a. rw-rw-rw-

b. rwxrw-r--

c. ---r--rw-

d. ----wx--x

New files receive rw-rw-rw- from the system less the umask. A umask of 731 will remove rwx-wx--x from these permissions (if present), leaving ---r--rw-.

10
New cards

You noticed a file in your home directory that has a + symbol appended to the mode. What does this indicate?

a. Special permissions have been set on the file.

b. The file has one or more files on the filesystem that are hard-linked to it.

c. The sticky bit directory permission has been set on the file and will remain inactive as a result.

d. Additional entries exist within the ACL of the file that can be viewed using the getfacl command.

d. Additional entries exist within the ACL of the file that can be viewed using the getfacl command.

A + symbol next to the mode of a file indicates that additional users and/or groups have been added to the access control list (ACL). You can use the getfacl command to view the full ACL.

11
New cards

When you change the data in a file that is hard-linked to three others, _____.

a. the data in the file you modified and the data in all hard-linked files are modified because they have different inodes

b. the data in the file you modified as well as the data in all hard-linked files are modified because they share the same data and inode

c. only the data in the file you modified is affected

d. only the data in the file you modified and any hard-linked files in the same directory are affected

b. the data in the file you modified as well as the data in all hard-linked files are modified because they share the same data and inode

Because hard links share the same inode and data section, all hard linked files are updated when you modify a single one.

12
New cards

The command chmod 317 file1 would produce which of the following lines in the ls command?

a. --w-r--rwx 1 user1 root 0 Apr 29 15:40 file1

b. --wx--xrwx 1 user1 root 0 Apr 29 15:40 file1

c. -rwxrw-r-x 1 user1 root 0 Apr 29 15:40 file1

d. --w-rw-r-e 1 user1 root 0 Apr 29 15:40 file1

b. --wx--xrwx 1 user1 root 0 Apr 29 15:40 file1

The permissions in a mode are represented by the numbers r (4), w (2), and x (1). Thus, 3 = wx (2+1), 1 = x, and 7 = rwx (4+2+1).

13
New cards

Which of the following commands will change the user ownership and group ownership of file1 to user1 and root, respectively?

a. chown user1:root file1

b. chown user1 : root file1

c. chown root:user1 file1

d. chown root : user1 file1

a. chown user1:root file1

You can specify either user1:root or user1.root as the first argument to the chown command to change the ownership of a file to the user1 user and root group.

14
New cards

What does the /var directory contain?

a. various additional programs

b. log files and spool directories

c. temporary files

d. files that are architecture-independent

b. log files and spool directories

The /var directory contains files that grow in size, such as log files and spool directories (e.g., print spools).

15
New cards

What does the mv command do? (Choose all that apply.)

a. It renames a file.

b. It renames a directory.

c. It moves a directory to another location on the filesystem.

d. It moves a file to another location on the filesystem.

e. All of the above.

e. All of the above.

The mv command can be used to rename files and directories within the same directory or move files and directories to a different directory.

16
New cards

*A file has the following permissions: r----x-w-. The command chmod 143 file1 would have the same effect as the command _____. (Choose all that apply.)

a. chmod u+x-r,g+r-x,o+x file1

b. chmod u=w,g=rw,o=rx file1

c. chmod u-r-w,g+r-w,o+r-x file1

d. chmod u=x,g=r,o=wx file1

e. chmod u+w,g+r-w,o+r-x file1

a. chmod u+x-r,g+r-x,o+x file1

d. chmod u=x,g=r,o=wx file1

The 143 permissions (--xr---wx) can be obtained by subtracting r and adding x to the user category, subtracting x and adding r to the group category, and adding x to the other category. Alternatively, you can use the = symbol to set the target permissions for the user, group, and other categories to x, r, and wx, respectively.

Let’s break down the permissions and the chmod command:

  • The initial permissions are r----x-w-:

    • User (u): read ®

    • Group (g): execute (x)

    • Others (o): write (w)

  • The chmod 143 command translates to:

    • User (u): execute (1)

    • Group (g): read (4)

    • Others (o): write and execute (3)

Now, let’s match these permissions with the options provided:

a. chmod u+x-r,g+r-x,o+x file1:

  • User: execute (x)

  • Group: read ®

  • Others: execute (x)

  • This does not match 143.

d. chmod u=x,g=r,o=wx file1:

  • User: execute (x)

  • Group: read ®

  • Others: write and execute (wx)

  • This matches 143.

17
New cards

The which command _____.

a. can only be used to search for aliases

b. searches for a file in all directories, starting from the root

c. is not a valid Linux command

d. searches for a file only in directories that are in the PATH variable

d. searches for a file only in directories that are in the PATH variable

18
New cards

Hard links need to reside on the same filesystem, whereas symbolic links need not be on the same filesystem as their target.

a. True

b. False

a. True

Since hard links share the same inode number, and inode numbers are unique to their filesystem, hard links cannot be made to files on other filesystems. Symbolic links do not share the same inode number and can be made to any file on any filesystem.

19
New cards

When applied to a directory, the SGID special permission _____.

a. allows users the ability to use more than two groups for files that they create within the directory

b. causes all new files created in the directory to have the same group membership as the directory, and not the entity that created them

c. causes users to have their permissions checked before they are allowed to access files in the directory

d. cannot be used because it is applied only to files

b. causes all new files created in the directory to have the same group membership as the directory, and not the entity that created them

When set on a directory, the SGID ensures that newly created files and subdirectories within are configured with the same group owner of the directory.

20
New cards

Given the following output from the ls command, how many other files are hard linked with file3?

drwxr-xr-x 3 root root 4096 Apr 8 07:12 Desktop

-rw-r--r-- 3 root root 282 Apr 29 22:06 file1

-rw-r--r-- 1 root root 282 Apr 29 22:06 file2

-rw-r--r-- 4 root root 282 Apr 29 22:06 file3

-rw-r--r-- 2 root root 282 Apr 29 22:06 file4

-rw-r--r-- 1 root root 282 Apr 29 22:06 file5

-rw-r--r-- 1 user1 sys 282 Apr 29 22:06 file6

a. one

b. two

c. three

d. four

c. three.

A link count of 4 indicates that four files share the same inode. Thus, there must be three other files that share the same inode as file3.

The number of hard links is indicated by the second column in the ls output. For file3, the number is 4, meaning there are 3 other files hard linked with it.

So, the correct answer is c. three.

The number 4 represents the total number of hard links to file3, including the file itself. Therefore, there are 3 other files that are hard linked to file3, making the total count 4.