Question: Discovery Exercises 1. Use the ls command with the -F option to explore directories described in the File- system Hierarchy Standard starting with /bin. Do
Discovery Exercises 1. Use the ls command with the -F option to explore directories described in the File- system Hierarchy Standard starting with /bin. Do you recognize any of the commands in /bin? Explore several other FHS directories and note their contents. Refer to Table 4-1 for a list of directories to explore. Further, visit www.pathname.com/fhs/ and read about the Filesystem Hierarchy Standard. What benefits does it offer Linux? 2. Write the commands required for the following tasks. Try out each command on your system to ensure that it is correct: a. Make a hierarchical directory structure under /root that consists of one directory containing three subdirectories. b. Copy two files into each of the subdirectories. c. Create one more directory with three subdirectories beneath it and move files from the subdirectories containing them to the counterparts you just created. d. Hard-link three of the files. Examine their inodes. e. Symbolically link two of the files and examine their link count and inode information. f. Make symbolic links from your home directory to two directories in this structure and examine the results. g. Delete the symbolic links in your home directory and the directory structure you cre- ated under /root. 3. Write the commands that can be used to perform the following tasks. (Hint: Try each out on the system to check your results.) a. Find all files on the system that have the word test as part of their filenames. b. Search the PATH variable for the pathname to the awk command. c. Find all files in the /usr directory and subdirectories that are larger than 50 Kilobytes in size. d. Find all files in the /usr directory and subdirectories that are less than 70 Kilobytes in size. e. Find all files in the / directory and subdirectories that are symbolic links. f. Find all files in the /var directory and subdirectories that were accessed less than 60 minutes ago. g. Find all files in the /var directory and subdirectories that were accessed less than six days ago. h. Find all files in the /home directory and subdirectories that are empty. i. Find all files in the /etc directory and subdirectories that are owned by the group bin.
i. Find all files in the /etc directory and subdirectories that are owned by the group bin.
4. For each of the following modes, write the numeric equivalent (for example, 777): a. rw-r--r-- b. r--r--r-- c. ---rwxrw- d. -wxr-xrw- e. rw-rw-rwx f. -w-r----- 5. Fill in the permissions in Table 4-7 with checkmarks, assuming that all four files are in the directory /public, which has a mode of rwxr-xr-x. 6. Fill in the permissions in Table 4-8 with checkmarks, assuming that all four files are in the directory /public, which has a mode of rwx--x---.
7. Foreachofthefollowingumasks,calculatethedefaultpermissionsgiventonewfilesand new directories: a. 017 b. 272 c. 777 d. 000 e. 077 f. 027 8. For each of the umasks in Discovery Exercise 7, list the umasks that are reasonable to use to increase security on your Linux system, and explain why. 9. Starting from the Linux default permissions for files and directories, what umask would you use to ensure that for all new ________________? a. directories, the owner would have read, write, and execute; members of the group would have read and execute; and others would have read b. files, the owner would have read and execute; the group would have read, write, and execute; and others would have execute c. files, the owner would have write; the group would have read, write, and execute; and others would have read and write d. directories, the owner would have read, write, and execute; the group would have read, write, and execute; and others would have read, write, and execute e. directories, the owner would have execute; the group would have read, write, and execute; and others would have no permissions f. files, the owner would have read and write; the group would have no permissions; and others would have write g. directories, the owner would have read, write, and execute; the group would have read; and others would have read and execute h. directories, the owner would have write; the group would have read, write, and exe- cute; and others would have read, write, and execute i. files, the owner would have no permissions; the group would have no permissions; and others would have no permissions 10. What chmod command would you use to impose the following permissions? a. On a directory such that the owner would have read, write, and execute; the group would have read and execute; and others would have read b. On a file such that the owner would have read and write; the group would have no permissions; and others would have write c. On a file such that the owner would have write; the group would have read, write, and execute; and others would have read and write d. On a file such that the owner would have read and execute; the group would have read, write, and execute; and others would have execute
e. On a directory such that the owner would have execute; the group would have read, write, and execute; and others would have no permissions f. On a directory such that the owner would have write; the group would have read, write, and execute; and others would have read, write, and execute g. On a directory such that the owner would have read, write, and execute; the group would have read; and others would have read and execute h. On a directory such that the owner would have read, write, and execute; the group would have read, write, and execute; and others would have read, write, and execute i. On a file such that the owner would have no permissions; the group would have no permissions; and others would have no permissions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
