โ† All Linux Flashcard Decks

Permissions Flashcards

7 cards from real Linux practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Permissions flashcards as text
  1. What does the sticky bit do when set on a directory?

    Answer: Prevents users from deleting files they do not own

    The sticky bit on a directory restricts file deletion so only the file owner, directory owner, or root can remove files.

  2. Which octal value represents rwxr-x--- for a file?

    Answer: 750

    rwx=7 for owner, r-x=5 for group, ---=0 for others gives octal 750.

  3. What is the effect of the setgid bit on a directory?

    Answer: New files inherit the directory's group ownership

    When setgid is set on a directory, newly created files and subdirectories inherit the directory's group rather than the creator's primary group.

  4. A file has permissions -rw-rw-r--. What is the umask that likely produced this from a default of 666?

    Answer: 002

    A umask of 002 subtracts write permission from others (666 - 002 = 664, i.e., rw-rw-r--).

  5. Which command changes the group ownership of a file to 'devs'?

    Answer: Both A and B

    Both `chgrp devs file.txt` and `chown :devs file.txt` correctly change the group ownership of a file.

  6. What does the execute permission on a directory allow a user to do?

    Answer: Enter the directory and access its contents

    Execute permission on a directory (also called search permission) allows users to traverse into it and access files if they know the names.

  7. How would you add write permission for the group on a file using symbolic mode?

    Answer: chmod g+w file.txt

    The symbolic syntax `chmod g+w file.txt` adds write permission for the group without affecting other permissions.