Chapter4
If a hard link is created to a file and then the original file is deleted, which of the following is true? a.The original file will be removed while the hard link remains usable to access the contents of the file. b.An error message will be displayed preventing the deletion of the original file. c.The original file will be removed while the hard link remains, though the content will not be accessible.
a. The original file will be removed while the hard link remains usable to access the contents of the file.
What is the complete path and filename for the database that is used by the locate and mlocate commands? a. /var/lib/mlocate/mlocate.db b. /etc/mlocate.db c. /etc/locate/mlocate.db d. /var/lib/locate/locate.db
a. /var/lib/mlocate/mlocate.db
What argument can be used with the chmod command to add read permission and remove write permission for a group on a file? a. g+r-w b. g-r+w c. o+r-w d. u+r+w
a. g+r-w
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 foo.txt bar.txt c. ln -s bar.txt foo.txt d. ln -h foo.txt bar.txt
a. ln bar.txt foo.txt
Which of the following commands will return one result of where the grep binary executable is located? (Choose two.) a. type grep b. find grep c. locate grep d. which grep
a. type grep d. which grep
The Filesystem Hierarchy Standard specifies what directory as the root user's home directory? a. /root b. /home/root c. /boot d. /bin
a. /root
Which of these commands will set the following permissions on file1.txt? User = Read, Write, Execute Group = Read, Execute Others = Read a. chmod 754 file1.txt b. chmod u=rwx, g=rx, u=r file1.txt c. chmod file1.txt 754 d. chmod o=rwx,g=rx,u=r file1.txt
a. chmod 754 file1.txt b. chmod u=rwx, g=rx, u=r file1.txt
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. rename projectx projecty c. move projectx projecty d. ren projectx projecty
a. mv projectx projecty
Which of the following umask settings will result in new files receiving the default permissions -rw-------? a. 0600 b. 0177 c. 0688 d. 0188
b. 0177
Which of the following commands will display all files and directories within the /var/log directory or its subdirectories which are owned by the root user? (Choose two.) a. find -uid root -print /var/log b. find /var/log -user root c. find -path /var/log -user root d. find -user root -print /var/log
b. find /var/log -user root
Which of the following permissions would show for a symbolic link when displayed with the ls -l command? a. srwxrwxrwx b. lrwxrwxrwx c. srw-r--r-- d. -rw-r--r--
b. lrwxrwxrwx
Which of the following are valid permissions for a directory where the command chmod 1777 has been used to set the permissions on it? a. trwxrwxrwx b. drwxrwxrwt c. Srwxrwxrwx d. drwxrwxrw-
b. drwxrwxrwt
Which of the following options will change the ownership of files and directories recursively within a directory? (Choose all that apply.) a. --follow b. -r c. -R d. --recursive
c. -R d. --recursive
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? a. 047 b. 620 c. 740 d. 026
c. 740
What would be the result of running the command chown :root file1.txt a. This would set the owner and group ownership of file1 to root. b.This would keep the current ownership of the file, and add root as a second owner of the file. c. This would set the group ownership of file1 to root. d. This would set the owner of file1.txt to root.
c. This would set the group ownership of file1 to root.
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? a. chmod 0000 filename b. chmod 6666 filename c. chmod 7777 filename d. chmod 777 filename
c. chmod 7777 filename
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.) a. ls -l b. ls -al c. ls -i d. ls -il
c. ls -i d. ls -il
Which of the following commands will delete a directory and all of the files contained within it? (Choose all that apply.) a. rm olddir b. rmdir -rf olddir c. rm -rf olddir d. rmdir olddir
c. rm -rf olddir
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. updatets file.txt b. stamp file.txt c. touch file.txt d. update file.txt
c. touch file.txt
ean 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 mlocate.db file in its default location. Which of the following commands should Jean run in an attempt to resolve this problem? a. mlocate --update b. apt upgrade mlocate c. updatedb d. locate --update
c. updatedb
Which of the following commands can be used to recursively search a directory tree for files that meet a certain criterion without using a database or premade index of files? a. search b. where c. locate d. find
d. find
Mindy wants to create a new subdirectory at ~/2019projects/projectx/projectplans to start storing the initial project plans for projectx. However, this is the first project she has worked on in 2019 and the 2019projects directory does not exist yet. Which of the following commands will create the higher level directories if they do not already exist? a. mkdir -v ~/2019projects/project/projectplans b. mkdir --all ~/2019projects/project/projectplans c. mkdir -r ~/2019projects/project/projectplans d. mkdir -p ~/2019projects/project/projectplans
d. mkdir -p ~/2019projects/project/projectplans
Nicholas wants to verify whether a file is a hard link to a file within the same directory. Which of the following commands could he use to see information that would be helpful to make this determination? a. ls -s b. ls -al c. ls -l d. ls -i
d. ls -i
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? a. /etc/locatedb.conf b. /etc/locate.d/updatedb.conf c. /etc/locate.conf d. /etc/updatedb.conf
d./etc/updatedb.conf
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. locate b. where c. mlocate d. find
find