Last Updated on March 1, 2022 by Admin 2

Special Directories and Files M18 Exam

  1. The /tmp directory is a temporary directory designed as a location where any user can create a temporary file. True or False?

    • True
    • False
  2. The sticky bit permission…

    • …prevents others from overwriting files they don’t own in common directories.
    • …sets the group ownership of any new file created in a directory.
    • …changes the group ownership of existing files in a directory.
    • …prevents others from removing files they don’t own from a common directory.
  3. Which of the following commands will set the sticky bit on /shared ?

    • chmod 6777 /shared
    • chmod 1777 /shared
    • chmod 2777 /shared
    • chmod 4777 /shared
  4. The setuid permission…

    • …allows a command to be run as the file owner.
    • …reports the output of a script to the owner.
    • …prevents the owner of a file from being changed.
    • …allows files in a directory to be manipulated as by the directory owner.
  5. Which of the following commands will set setuid for the /usr/bin/program?

    • None of the above
    • chmod 2755 /usr/bin/program
    • chmod 1755 /usr/bin/program
    • chmod 4755 /usr/bin/program
  6. The setgid permission… (choose two)

    • …prevents the group owner of a file from being changed.
    • …can only be set on files.
    • …allows a command to be run as the group owner of the file.
    • …allows files created in a directory to be owned by the group that owns the directory.
  7. Which of the following commands will set setgid on /shared ?

    • chmod 2777 /shared
    • chmod 1777 /shared
    • chmod 7777 /shared
    • None of these options are correct
    • chmod 4777 /shared
  8. Which of the following long listings represents setgid set for /shared ?

    • drwxrwsrwx. 12 root group 4096 Oct 21 13:12 /shared
    • drwsrwxrwx. 12 root group 4096 Oct 21 13:12 /shared
    • drwSrwxrwx. 12 root group 4096 Oct 21 13:12 /shared
    • drwxrwxrws. 12 root group 4096 Oct 21 13:12 /shared
  9. Setting setgid on a directory…

    • …is not allowed by the system.
    • …will allow scripts in the directory to be executed as the group owner of the directory.
    • …does nothing.
    • …will set the group owner of all files created in the directory to the group owner of the directory.
  10. Deleting a source file will break an associated hard link. True or False?

    • True
    • False
  11. A source and a hard link must be part of the same filesystem. True or False?

    • True
    • False
  12. Deleting a source file will break an associated symbolic link. True or False?

    • True
    • False
  13. A source file and a symbolic link must be part of the same file system. True or False?

    • True
    • False
  14. Which of the following commands would create a hard link, link to file?

    • ln link file
    • ln file link
    • ln -s file link
    • ln -s link file
  15. Which of the following commands would create a symbolic link, link to file?

    • ln file link
    • ln link file
    • ln -s file link
    • ln -s link file
  16. Which of the following ls commands, when executed, will only show information about the directory itself? (choose two)

    • ls -ld
    • ls -h
    • ld -a
    • ls -d
  17. Which of the following directories are designed as locations where any user can create a temporary file? (choose two)

    • /lost+found
    • /sbin
    • /tmp
    • /home
    • /var/tmp