Linux Chapter 4
Which of the following options will change the ownership of files and directories recursively within a directory? (Choose all that apply.)
--recursive -R
Lynn runs the locate command and the results include many files from a directory that she doesn't want to include in her search. Which of the following files could Lynn modify so that the locate command no longer includes those results?
/etc/updatedb.conf
The Filesystem Hierarchy Standard specifies what directory as the root user's home directory?
/root
Which of the following umask settings will result in new files receiving the default permissions rw-------?
177
Jan needs to set permissions on a file so that the owner has read, write, and execute permissions. The group should have read permissions only, and everyone else should have no access. Which of the following parameters, when used with the chmod command, would set the permissions described?
740
If a hard link is created to a file and then the original file is deleted, which of the following is true?
The original file will be removed while the hard link remains usable to access the contents of the file.
What would be the result of running the command chown :root file1.txt?
This would set the group ownership of file1 to root.
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?
chattr +i securedata.bin
Which of these commands will set the following permissions on file1.txt?User = Read, Write, ExecuteGroup = Read, ExecuteOthers = Read
chmod 754 file1.txt chmod u=rwx,g=rx,u=r file1.txt
In order to set all of the special permissions on a certain file or directory, which command should be used on a file named filename?
chmod 7777 filename
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?
find
Nicholas wants to identify the other files that are hard linked to a particular file. He issues the ls -li command and notes that the file has a link count of 4 and inode number of 3456. Which of the following commands could he use to locate the other hard linked files on the system?
find / -inum 3456
Which of the following commands will display all files and directories within the /var/log directory or its subdirectories that are owned by the root user?
find /var/log -user root
What argument can be used with the chmod command to add read permission and remove write permission for the group owner of a file?
g+r-w
Julian notices a + symbol following the mode of a file when running the ls -l command. What command should Julian run next to view the information provided by the + symbol?
getfacl
Which of the following commands will create a symbolic link named foo.txt to an original file named bar.txt?
ln -s bar.txt foo.txt
Which of the following indicate a symbolic link when displayed with the ls -l command?
lrwxrwxrwx
Jamie has created a hard link to another file within the same directory. Which of the following commands can he use to verify that the hard link was created correctly? (Choose all that apply.)
ls -il ls -i
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?
lsattr
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?
mkdir -p ~/2023projects project/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?
mv projectx projecty
Which of the following commands will delete a directory and all of the files contained within it?
rm -rf olddir
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?
rwx
Which of the following are valid permissions for a directory where the command chmod 1777 has been used to set the permissions on it?
rwxrwxrwt
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?
setfacl -m g:acctg:rw project.csv
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?
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?
updatedb
Which of the following commands will return the absolute path on the filesystem to the grep binary executable? (Choose all that apply.)
whereis grep which grep