Ch.4 Linux Filesystem Management

Ace your homework & exams now with Quizwiz!

Only the root user can modify a file that has the immutable attribute set. True False

False

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. True False

False

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

False - it is indicated by l (Lowercase L)

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

True

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, d

Which of the following umask settings will result in new files receiving the default permissions rw-------? a. 177 b. 688 c. 600 d. 188

a. 177

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.

After typing the ls -l 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.

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

Mindy wants to create a new subdirectory at ~/2023projects/projectx/projectplans to start storing the initial project plans for projectx. However, this is the first project she has worked on in 2023 and the 2023projects directory does not exist yet. Which of the following commands will create the higher level directories if they do not already exist? a. mkdir -p ~/2023projects/projectx/projectplans b. mkdir -r ~/2023projects/projectx/projectplans c. mkdir --all ~/2023projects/projectx/projectplans d. mkdir -v ~/2023projects/projectx/projectplans

a. mkdir -p ~/2023projects/projectx/projectplans

Jim wants to rename a directory for a project that he has been working on. Which of the following commands can he use to perform that action? a. mv projectx projecty b. ren projectx projecty c. move projectx projecty d. rn projectx projecty

a. mv projectx projecty

Jillian performs a long listing on a directory and notices that a file called securedata.xml has an owner of bparsons, group owner of ctlgroup, and mode of rw-r-----. What permissions does the root user have to this file? a. rwx b. r c. no permissions d. rw

a. rwx

Which of the following commands can be used to update the last modified timestamp on a file, or if the file specified does not exist will create the file? a. touch file.txt b. update file.txt c. updatets file.txt d. stamp file.txt

a. touch file.txt

Jean installs a distribution of Linux on a workstation and attempts to run the locate command to find a certain file. Instead of returning the results she expected, an error message is displayed that it cannot find the plocate.db file in its default location. Which of the following commands should Jean run in an attempt to resolve this problem? a. updatedb b. mlocate --update c. locate --update d. apt upgrade mlocate

a. updatedb

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.

all of them

Which of the following commands will return the absolute path on the filesystem to the grep binary executable? (Choose all that apply.) a. type grep b. whereis grep c. find grep d. which grep

b, d

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

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

In order to set all of the special permissions on a certain file or directory, which command below should be used on a file named filename? a. chmod 777 filename b. chmod 7777 filename c. chmod 0000 filename d. chmod 6666 filename

b. chmod 7777 filename

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

Jose needs to ensure that members of the newly created acctg group have read and write permissions on the project.csv file. However, he cannot modify the existing group owner on the file, and other users cannot be allowed access to the file via the other category in the mode. Which of the following commands can Jose use to achieve his goal? a. chmod 2660 project.csv b. setfacl -m g:acctg:rw project.csv c. chmod 1660 project.csv d. setfacl -a acctg -p rw project.csv

b. setfacl -m g:acctg:rw project.csv

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

The Filesystem Hierarchy Standard specifies what directory as the root user's home directory? a. /bin b. /home/root c. /root d. /boot

c. /root

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

Which of the following commands can be used to recursively search through the directory tree in search of a file that meets a set of given criteria instead of using an indexed database? a. where b. mlocate c. find d. locate

c. find

alternative command to chown user1:root file1, ______________________.

chown user1.root file1

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

d. ----wx--x

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.

The 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.

Which of the following commands can be used to ensure that no user on the system, including the root user, can modify the contents of the securedata.bin file? a. setfacl -b securedata.bin b. chown nobody:nobody securedata.bin c. chmod 000 securedata.bin d. chattr +i securedata.bin

d. chattr +i securedata.bin

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

d. four

Which of the following commands will create a symbolic link named foo.txt to an original file named bar.txt? a. ln bar.txt foo.txt b. ln -h foo.txt bar.txt c. ln foo.txt bar.txt d. ln -s bar.txt foo.txt

d. ln -s bar.txt foo.txt

Which of the following indicate a symbolic link when displayed with the ls -l command? a. srw-r--r-- b. srwxrwxrwx c. -rw-r--r-- d. lrwxrwxrwx

d. lrwxrwxrwx

Nashina is logged in as the root user account on a production Linux server but is unable to modify a particular configuration file. What command can be used to verify whether the configuration file is read-only? a. getfacl b. chmod --list c. ls -li d. lsattr

d. lsattr

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 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

What option is needed when using the ln command to create a symbolic link between two files? Which file goes first in the command, original file or the name of the link to create?

ln -s [original file] [name of file you want to link]

This command can be used to add additional user and group categories to the mode of a file.

setfacl -m


Related study sets

Chapter 8 Intellectual Property Rights

View Set

CFA study session 8: financial reporting and analysis

View Set

ICT 10: Basic Programming Concept

View Set

Quiz 7_CH13_Experimental Design and ANOVA

View Set