CEST-CE Term_2 GNU/LINUX (Week 4)
50 Questions
2 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is stored with the inode, not the name?

  • File contents
  • Inode number
  • Attributes (correct)
  • Permissions
  • What command can be used to see the inode numbers paired with each name?

  • find -inum
  • ls -l
  • ls -i (correct)
  • mv -i
  • What is the purpose of the link count in a hard link?

  • Counts the number of permissions
  • Counts the number of inodes
  • Counts the number of names (correct)
  • Counts the number of directories
  • What is a soft link also known as?

    <p>Symbolic link</p> Signup and view all the answers

    What is the link count of an empty directory?

    <p>Two</p> Signup and view all the answers

    What can the super-user account root do on a Unix system?

    <p>Access and do anything to any inode</p> Signup and view all the answers

    Why are soft links considered second-class citizens?

    <p>Because they are not as reliable as hard links</p> Signup and view all the answers

    What happens when you try to access a dangling symlink?

    <p>You get a confusing error message</p> Signup and view all the answers

    What is the purpose of the -inum expression operator in the find command?

    <p>To find all files with a given inode number</p> Signup and view all the answers

    What is the difference between a hard link and a symbolic link?

    <p>A hard link points to an inode, a symbolic link points to a file name</p> Signup and view all the answers

    What is the primary function of the /etc/passwd file?

    <p>To map a user ID number to a name</p> Signup and view all the answers

    What is the purpose of the usermod command?

    <p>To change the name of a user or group</p> Signup and view all the answers

    How many owners can a file system inode have?

    <p>One user ID and one group ID</p> Signup and view all the answers

    What determines the permissions of a process?

    <p>The user ID and group IDs of the process</p> Signup and view all the answers

    What is the purpose of the groups command?

    <p>To display the group IDs of the current user</p> Signup and view all the answers

    What type of permission is required to execute a file?

    <p>eXecute permission</p> Signup and view all the answers

    What happens when you change the permissions of a symbolic link?

    <p>Nothing happens, permissions are ignored on symbolic links</p> Signup and view all the answers

    What is the purpose of the chmod command?

    <p>To change the permissions of a file</p> Signup and view all the answers

    What type of link is a directory entry that points to an inode?

    <p>Hard link</p> Signup and view all the answers

    What is the relationship between a directory and its inode?

    <p>A directory is a name that points to an inode</p> Signup and view all the answers

    What is the term 'file' often referred to in Unix/Linux?

    <p>Anything in the file system: files, directories, links, devices, etc.</p> Signup and view all the answers

    What can be read as if it were a regular file, with sufficient permissions?

    <p>Devices</p> Signup and view all the answers

    What do directories map?

    <p>Names to inode numbers</p> Signup and view all the answers

    What is a characteristic of inodes?

    <p>They are a fixed resource</p> Signup and view all the answers

    What is stored in inodes?

    <p>Pointers to disk blocks and attributes</p> Signup and view all the answers

    What is the relationship between a directory and its inode?

    <p>A directory maps to its inode</p> Signup and view all the answers

    What is the purpose of the ROOT directory inode?

    <p>It has no name because there is no directory above it to give it one</p> Signup and view all the answers

    What is the result of having multiple names for one inode?

    <p>One inode, many names</p> Signup and view all the answers

    What is the relationship between an inode and a file system object?

    <p>An inode contains information about a file system object</p> Signup and view all the answers

    What do the file system diagrams show?

    <p>The file system hierarchy and how the information is actually stored on the disk</p> Signup and view all the answers

    Which operation is not a directory operation?

    <p>Changing the permissions of a file</p> Signup and view all the answers

    What is the purpose of a link count in a hard link?

    <p>To count the number of names associated with an inode</p> Signup and view all the answers

    What happens when you try to access a symbolic link that points to a non-existent file?

    <p>The system returns an error message</p> Signup and view all the answers

    What is the relationship between a directory and its inode?

    <p>A directory points to an inode</p> Signup and view all the answers

    What is the primary advantage of having multiple names for one inode?

    <p>It allows for increased flexibility in file system organization</p> Signup and view all the answers

    What is the term for a directory entry that points to an inode?

    <p>Name</p> Signup and view all the answers

    What is the primary function of the /etc/group file?

    <p>Maps each group ID number to a name</p> Signup and view all the answers

    What is the purpose of the usermod and groupmod commands?

    <p>To change the name of a user or a group</p> Signup and view all the answers

    What is the relationship between a directory and its inode?

    <p>A directory is a name, and an inode is the content</p> Signup and view all the answers

    What is the purpose of the id command?

    <p>To show the user ID and group IDs of the current user</p> Signup and view all the answers

    How many group IDs can a process have?

    <p>One or multiple</p> Signup and view all the answers

    What is the purpose of the whoami command?

    <p>To show the name of the current user</p> Signup and view all the answers

    What is stored in the inode?

    <p>The file permissions and owner/group IDs</p> Signup and view all the answers

    What is the result of having multiple names for one inode?

    <p>The file has multiple names, also known as hard links</p> Signup and view all the answers

    What is a directory in Unix/Linux?

    <p>A mapping of names to inode numbers</p> Signup and view all the answers

    What is the purpose of inodes in a file system?

    <p>To contain pointers to disk blocks and file attributes</p> Signup and view all the answers

    What is the result of having multiple names for one inode?

    <p>The mapping of multiple names to one inode</p> Signup and view all the answers

    What is stored in an inode?

    <p>All of the above</p> Signup and view all the answers

    What is the root directory inode?

    <p>An inode that has no name</p> Signup and view all the answers

    What do file system diagrams show?

    <p>The relationship between directories and inodes</p> Signup and view all the answers

    Study Notes

    Directories and Inodes

    • Every directory except the ROOT directory has a name, which is stored in a directory inode above it.
    • Directories hold only names and inode numbers, not attributes.
    • Attributes are stored with the inode, not the name.

    Inodes

    • An inode stores attribute information of a file system object.
    • To find out attribute information, you must use the inode number to find the inode and look at the item's attributes.
    • Inodes contain pointers to disk blocks.
    • Inodes contain attributes (owners, permissions, times, etc.).
    • Inodes are unique inside a file system.
    • Inodes are a fixed resource.
    • Multiple names can point to the same inode (hard links).
    • The link count counts the number of names pointing to an inode.
    • Creating a hard link (ln) increases the link count, while removing a name (rm) decreases the link count.
    • An empty directory has a link count of two.
    • Soft links are created using the ln command with the -s option.
    • Soft links can be dangling, meaning the target does not exist.
    • Soft links are second-class citizens.
    • Relative and absolute targets can be used for soft links.

    File Systems and Permissions

    • Unix/Linux is a multi-user system, with the super-user account (root) having access to everything.
    • File systems contain names of directories and files.
    • Files are a list of bytes.
    • Even hardware devices have file names.
    • Inodes contain information on file system objects.
    • Permissions are used to control access to file system objects.

    Users, Groups, and Processes

    • The password file (/etc/passwd) maps a user ID number to a name.
    • The group file (/etc/group) maps each group ID number to a name.
    • User IDs and group IDs are used to calculate permissions.
    • Processes run with a user ID and multiple group IDs.

    Permissions and Inodes

    • Inodes have one owner (user ID) and one group.
    • Permissions are used to match the login user ID and groups to inode owner and group.
    • Symbolic mode and numeric mode can be used to set permissions.
    • Permissions can be set for the owner, group, and others.
    • Execute/Search permissions are used for directories.

    Directories and Inodes

    • Every directory except the ROOT directory has a name, which is stored in a directory inode above it.
    • Directories hold only names and inode numbers, not attributes.
    • Attributes are stored with the inode, not the name.

    Inodes

    • An inode stores attribute information of a file system object.
    • To find out attribute information, you must use the inode number to find the inode and look at the item's attributes.
    • Inodes contain pointers to disk blocks.
    • Inodes contain attributes (owners, permissions, times, etc.).
    • Inodes are unique inside a file system.
    • Inodes are a fixed resource.
    • Multiple names can point to the same inode (hard links).
    • The link count counts the number of names pointing to an inode.
    • Creating a hard link (ln) increases the link count, while removing a name (rm) decreases the link count.
    • An empty directory has a link count of two.
    • Soft links are created using the ln command with the -s option.
    • Soft links can be dangling, meaning the target does not exist.
    • Soft links are second-class citizens.
    • Relative and absolute targets can be used for soft links.

    File Systems and Permissions

    • Unix/Linux is a multi-user system, with the super-user account (root) having access to everything.
    • File systems contain names of directories and files.
    • Files are a list of bytes.
    • Even hardware devices have file names.
    • Inodes contain information on file system objects.
    • Permissions are used to control access to file system objects.

    Users, Groups, and Processes

    • The password file (/etc/passwd) maps a user ID number to a name.
    • The group file (/etc/group) maps each group ID number to a name.
    • User IDs and group IDs are used to calculate permissions.
    • Processes run with a user ID and multiple group IDs.

    Permissions and Inodes

    • Inodes have one owner (user ID) and one group.
    • Permissions are used to match the login user ID and groups to inode owner and group.
    • Symbolic mode and numeric mode can be used to set permissions.
    • Permissions can be set for the owner, group, and others.
    • Execute/Search permissions are used for directories.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Week 4.docx

    Description

    This quiz explores the concepts of directories and inodes in file system management, including their structure and attributes. Learn how directories and inodes are organized and how they store information about file system objects.

    More Like This

    Use Quizgecko on...
    Browser
    Browser