{
  "id": 10771906,
  "title": "Unix File and Directory Permissions and Modes (2018)",
  "url": "https://urgent.news/2026/09/29/unix-file-and-directory-permissions-and-modes-2018",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-29T18:22:20.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://wpollock.com/AUnix1/FilePermissions.htm"
  },
  "original_language": "en",
  "account": "Unix and Linux systems, including Mac OS X and other POSIX compliant operating systems, utilize a relatively straightforward mechanism for managing access to files and directories. This approach is outlined in the POSIX.1:2008 standard, also known as the Single Unix Specification (SUS version 4). The system applies to any device with a file name, such as disks and ports, just as it does for regular files under the /dev directory.\n\nThe system assigns a user and a group to each file, subsequently categorizing users into three classes. Each class is permitted three potential permissions: read, write, and execute. Consequently, a total of nine distinct permissions can be assigned to a file, allowing for various combinations. However, not all combinations are practical or necessary.\n\nTo access a file's data, read permission is required. To modify a file's data, write permission is necessary. Lastly, to execute a file—be it a program or a script—execute permission is mandatory. In Unix-like systems, directories are also treated as files, thereby adhering to the same permission system as regular files. However, it's crucial to note that permissions assigned to directories do not automatically extend to files within those directories. This distinction stems from the unique role directories play in the file system hierarchy.\n\nWhen listing files within a directory, read permission is required for the directory itself, but not for the individual files contained therein. Conversely, adding, deleting, or renaming files necessitates write permission for the directory; however, this does not extend to the files within. It's also worth noting that execute permission, while not applicable to directories, serves other purposes. For instance, it is utilized when attempting to change the current working directory (cd) or accessing the inode information of files within a directory.\n\nRead and execute permissions on directories essentially serve different purposes. Read permission allows access to the file names within the directory, while execute permission, also referred to as search permission, enables access to the inode information of the files within. This distinction is crucial, as inode information is required to locate a file's inode number. Without search permission, commands like 'cat' cannot locate the inode of a file, rendering them unable to read the file.\n\nWrite permission on a directory is essential for adding, renaming, or deleting files within that directory. This is because these actions necessitate changes to or at least reading of the inodes of the affected files. In essence, permissions do not determine which commands can access files; instead, they dictate which system calls can access files. The specific permissions required for system calls are documented in the man pages for each command. Consequently, to understand what permissions are needed to run a particular command on a file, one must consider the system calls that command would invoke.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}