Skip to content
Info Influx
Menu
  • Home
  • Oracle
  • Linux
  • SQL
  • Windows
  • Privacy Policy
  • About Us
  • Contact
Menu

Linux Permissions for Files & Directory

Posted on July 31, 2023August 14, 2023 by siteadmin

In Linux file & directory permissions are crucial for maintaining security and controlling access to files and directories. Linux uses a permission system based on three levels of access: read (r), write (w), and execute (x). These permissions are defined separately for three types of users: the file owner, the group associated with the file, and other users who are not the owner or part of the group.

The permission settings are represented by a 10-character string, where the first character indicates the file type (e.g., regular file, directory, symbolic link, etc.), and the next nine characters represent the permissions for the owner, group, and others. Here’s how the nine permission characters are organized:

-rwxrwxrwx
  |  |  |
  |  |  +--- Others' permissions (e.g., read, write, execute)
  |  +------ Group's permissions (e.g., read, write, execute)
  +--------- Owner's permissions (e.g., read, write, execute)

The permission characters can be one of the following:

  • r (read): Allows the user to read the content of the file or list the contents of the directory.
  • w (write): Allows the user to modify (write to) the file or create/delete files in the directory.
  • x (execute): Allows the user to execute a file (for directories, it allows access to enter the directory and access its contents).

The possible file types include:

  • – (hyphen): Indicates a regular file.
  • d (directory): Indicates a directory.
  • l (symbolic link): Indicates a symbolic link.
  • c (character device): Indicates a character device file.
  • b (block device): Indicates a block device file.
  • s (local socket): Indicates a local socket.
  • p (named pipe): Indicates a named pipe (FIFO).

Here are some examples of common permission settings:

  • rw-r--r--: A file with read and write permissions for the owner and read-only permissions for the group and others.
  • drwxr-xr-x: A directory with read, write, and execute permissions for the owner, and read and execute permissions for the group and others.
  • lrwxrwxrwx: A symbolic link with read, write, and execute permissions for the owner, group, and others.

To modify permissions, you can use the chmod command.

For example:

  • chmod 755 filename: Sets read, write, and execute permissions for the owner, and read and execute permissions for the group and others.
  • chmod +x script.sh: Adds execute permission to the file script.sh.
  • chmod u-x file.txt: Removes execute permission from the owner for file.txt.

It’s important to carefully manage permissions to ensure the security and integrity of files and directories on a Linux system. Avoid granting unnecessary permissions to users to prevent unauthorized access or modifications.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Multiplexing of Control Files
  • ORA-12012: error on auto execute of job SYS.ORA$AT_OS_OPT_SY_
  • Install Oracle 19c on Linux
  • Upgrade Oracle Database 12c to 19c (DBUA)
  • Install Oracle Database 12.2 on Linux

Archives

  • October 2023
  • August 2023
  • July 2023

Categories

  • Linux (7)
  • Oracle (25)
  • SQL (1)
  • Windows (3)
© 2026 Info Influx | Powered by Rama Solutions