CompTIA Linux+ - Chapter 4 Homework

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

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. ---r--rw- b. rw-rw-rw- c. rwxrw-r-- d. ----wx--x

a. ---r--rw- Explanation: A umask of 731 subtracts from default permissions, resulting in file permissions of 046 (---r--rw-).

What does the mv command do? (Choose all that apply.) a. It moves a directory to another location on the filesystem. b. It renames a file. c. It renames a directory. d. It moves a file to another location on the filesystem.

a. It moves a directory to another location on the filesystem. b. It renames a file. c. It renames a directory. d. It moves a file to another location on the filesystem.

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 cp -interactive or mv -interactive. c. Run interactive cp or interactive mv. d. Run cp -i or mv -i.

a. Just run cp or mv because they run in interactive mode by default. Explanation: On Fedora Linux, cp and mv are typically aliased to run in interactive mode by default.

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 Explanation: Hard links must be on the same filesystem; symbolic links can cross filesystems.

What does the /var directory contain? a. log files and spool directories b. various additional programs c. files that are architecture-independent d. temporary files

a. log files and spool directories Explanation: /var contains variable data like logs, spools, and caches.

The command chmod 317 file1 would produce which of the following lines in the ls command? a. --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 c. -rwxrw-r-x 1 user1 root 0 Apr 29 15:40 file1 d. --w-r--rwx 1 user1 root 0 Apr 29 15:40 file1

b. --wx--xrwx 1 user1 root 0 Apr 29 15:40 file1 Explanation: 317 corresponds to user: --x, group: --r, others: rwx.

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 Explanation: A lowercase "s" indicates the execute bit is also set, while an uppercase "S" means the execute bit is not set.

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

b. False Explanation: Once the immutable attribute is set, not even root can modify or delete the file unless the attribute is first removed with chattr -i.

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 Explanation: The @ symbol appears at the end of the filename in ls -l, not the beginning, to indicate a symbolic link.

When applied to a directory, the SGID special permission _____. a. causes users to have their permissions checked before they are allowed to access files in 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. allows users the ability to use more than two groups for files that they create within 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 Explanation: SGID on a directory ensures that new files inherit the directory's group.

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. rwxrwxrwx and rw-rw-rw- c. rw-rw-rw- and rwxrwxrwx d. rw-rw-rw- and r--r--r--

b. rwxrwxrwx and rw-rw-rw- By default, directories are created with 777 (rwxrwxrwx) and files with 666 (rw-rw-rw-) before applying the umask.

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. Run chgrp again listing the root user as the new owner. b. Have the new owner run chgrp and list the root user as the new owner. c. Run chown and list the root user as the new owner. d. Nothing, because this is a one-way, one-time action.

c. Run chown and list the root user as the new owner. Explanation: The root user can regain ownership by using the chown command and specifying themselves as the new owner.

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. Members of the root group have read and write, user1 has read and execute, and all others have read permissions to the file. b. All users have read and write, members of the root group have read and execute, and user1 has read permissions to the file. c. User1 has read and write, members of the root group have read and execute, and all others have 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.

c. User1 has read and write, members of the root group have read and execute, and all others have read permissions to the file. Explanation: The permission string -rw-r-xr-- means user1 has read/write, group has read/execute, and others have read.

Which of the following commands will change the user ownership and group ownership of file1 to user1 and root, respectively? a. chown root : user1 file1 b. chown user1 : root file1 c. chown user1:root file1 d. chown root:user1 file1

c. chown user1:root file1 Explanation: The correct syntax is chown user:group filename.

When you change the data in a file that is hard-linked to three others, _____. a. only the data in the file you modified is affected b. the data in the file you modified and the data in all hard-linked files are modified because they have different inodes c. 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 d. only the data in the file you modified and any hard-linked files in the same directory are affected

c. 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 Explanation: Hard links share the same inode, so any changes to one affect all linked files.

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. two b. four c. three d. one

c. three Explanation: The link count is 4, so file3 has 3 other hard links.

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. Explanation: The + symbol means the file has extended ACLs, viewable with getfacl.

What was created to define a standard directory structure and common file location for UNIX and Linux systems? a. X.500 b. OOBLA c. POSIX d. FHS

d. FHS Explanation: The Filesystem Hierarchy Standard (FHS) was created to define a consistent directory structure for UNIX/Linux systems

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-r-w,g+r-w,o+r-x file1 b. chmod u=w,g=rw,o=rx file1 c. chmod u+w,g+r-w,o+r-x file1 d. chmod u=x,g=r,o=wx file1 e. chmod u+x-r,g+r-x,o+x file1

d. chmod u=x,g=r,o=wx file1 e. chmod u+x-r,g+r-x,o+x file1 Explanation: Mode 143 translates to u: execute, g: read, o: write/execute.

The which command _____. a. searches for a file in all directories, starting from the root b. can only be used to search for aliases 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 Explanation: which searches for an executable in directories listed in the PATH variable.


संबंधित स्टडी सेट्स

PEDS: Chapter 44: Nursing Care of a Family when a Child has a Hematologic Disorder Prep-U

View Set

Neuromuscular Patient Management I - Midterm Exam

View Set