Skip to content
  • Home
  • Contact Us
  • About Us
  • Privacy Policy
  • DMCA
  • Linkedin
  • Pinterest
  • Facebook
thecscience

TheCScience

TheCScience is a blog that publishes daily tutorials and guides on engineering subjects and everything that related to computer science and technology

  • Home
  • Human values
  • Microprocessor
  • Digital communication
  • Networking
  • Toggle search form
access permissions in linux

Access permissions in linux

Posted on December 13, 2022January 29, 2023 By YASH PAL No Comments on Access permissions in linux

Every File or directory in Linux has access permissions. There are three types of permissions

  • read
  • write
  • execute

Permissions are defined for three types of users:

  • the owner of the file
  • the group that the owner belongs to.
  • other users

Thus, Linux access permissions are nine bits of information (3 types x 3 types of users), and each of them may have just one of two values: allowed or denied


Table of Contents

  • File Permission
    • Viewing File Permissions
  • Directory Permissions

File Permission

These three types of permission mean slightly different things for files than for directories For files, these permissions grant these rights

  • read Allowed to read the contents of the file
  • write Allowed to modify or delete the file.
  • execute Allowed to run the file as a process, if possible

Viewing File Permissions

The ls command is used to list files and the content of directories. The -l parameter displays permissions. For example, to see the permissions of a file named foo in the file directory/user/bin/bar, you would execute:

ls – l/user/bin/bar/foo


And the command would return something like this:

-rwxr – xr– 1 jsmith guest 3072 June 10 10:25/user/bin/foo


In the example, jsmith is the account that owns foo, and guest is the name of the group that owns/user/bin/foo


The -rwxr – xr– at the left indicates the permissions. The first character the- indicates that/user/bin/foo is a file, not a directory. The rwx shows the permissions for the user class of accounts — in this case, jsmith. The r indicates read permissions, the w writes permissions, and the x executes permission. The following three characters, r-x, show permissions for the group class of accounts, which is guest in this example. Finally, the last three characters, r – -, display permissions for the other class – – any account that is not jsmith and is not in the guest group.


  • r– Read, write and execute permissions for all other users.
  • rw- Read, write and execute permissions for members of the group owning the file
  • rwx Read, write and execute permissions for the other owner of the file.
  • – File type. “-” indicates a regular file. A”d”indicates a directory.

Directory Permissions

While you are logged in on a character-based interface to a Linux system, you are always associated with a directory. The directory you are associated with is the working directory or current directory. When you first log in, the working directory is your home directory.


For directories, the permissions grant these rights:

  • read Allowed to list the contents of the directory.
  • write Allowed to create, modify or delete files in the directory.
  • execute Allowed to access a file in the directory if you know the name of the file.

Viewing Directory Permissions: If you want to see the permissions of the /user/bin/bar directory itself, not its contents, then you need to use the -d command line argument for .s. So, you would execute this command.

ls-ld /user/bin/bar

and you would see something like this:

dr-xrwxr-x 3 jsmith guest 4096 June 10 10.25/user/bin/bar

Permission may also be granted in octal codes.

S.No.DescriptionAbbreviationoctal code
1.Read accessr4
2.Write (Change) permissionsw2
3.Execute script of binary executablex1
4.Read and executerx5
5.Read and writerw6
6.Read, write and executerwx7

The use of octal assignments does not add or remove permissions but assigns the permission explicitly.

engineering subjects, linux Tags:engineering subjects, linux

Post navigation

Previous Post: File system in Linux
Next Post: Changing File Access Permissions in Linux

Related Posts

Operations of Microprocessor engineering subjects
O Level Exam Syllabus and Tips for Examination developer guide
Domain Name System (DNS) and Workgroup Digital communication
What is concrete? – Ingredient of concrete? civil engineering
Characteristics of Internet | Digital Communication Digital communication
Pin Configuration of 8085 Microprocessor engineering subjects

Leave a Reply Cancel reply

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

Pick Your Subject
Human Values

Copyright © 2023 TheCScience.

Powered by PressBook Grid Blogs theme