0% found this document useful (0 votes)
2 views

File Permissions

The document explains file permissions in Bash and Z Shell, detailing the roles of the file owner, group, and others. It describes how to modify these permissions using the chmod command in both symbolic and numeric modes. Examples illustrate how to add, remove, and set permissions effectively.

Uploaded by

akym
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

File Permissions

The document explains file permissions in Bash and Z Shell, detailing the roles of the file owner, group, and others. It describes how to modify these permissions using the chmod command in both symbolic and numeric modes. Examples illustrate how to add, remove, and set permissions effectively.

Uploaded by

akym
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

"Managing Files Using Bash and Z Shell" course by Mateo Prigl at Pluralsight

File Permissions
Each file has defined permissions for the file owner, file group and others.
Others are all of the users which do not belong to the file group and are also
not the owner of the file. Each of these has a set of three characters
representing the file permissions.
r represents read permission. If it is set on a file, that means that you can open
and read the contents of that file. On a directory, this means that you can use ls
to list the contents of that file.
w write permissions let's you edit file contents. If it is set on a directory, that
means that you can add, remove and rename files within that directory.
x execute permissions is usually set on executable files, which means that you
have the authorization to execute them. Those are usually binaries, executable
programs and scripts, just like the commands we use from the shell. On a
directory, this permissions let's us enter it with the cd command.

You can change the file permissions with the chmod command. You have two
modes which you can use to change them. Symbolic mode lets you change
permissions by writing letters. First you need to type which set of permissions
you want to modify. u for user (which is the file owner), g for group, o for
others and a for all of them at once.
Than you can define which permissions you want to set. You can do this with
the = sing following the wanted permissions like rwx. You can also just add
some permissions with +, e.g. u+x will add the execute permission to the file
owner. Same goes for removing permissions with -.

After that you need to put the name of the file you want to modify.

$ chmod a+w filename

In this example I added the write permission to all.

1/2 © Copyright 2020 by Pluralsight


"Managing Files Using Bash and Z Shell" course by Mateo Prigl at Pluralsight

There is also a numeric mode. Each permission has an assigned number. x has
1, w has 2 and r has 4. By combining these numbers, you can set the
permissions on a file. In this mode, you are setting all of the permissions at
once, so you don't need to define which set you want to change.
$ chmod 766 filename

This example will change the permissions to 776. This resolves to rwxrwxrw-.
r(4) + w(2) + x(1) gives us rwx(7). This is set for file owner and file group. The
last number is 6 because r(4) + w(2) is rw-(6).

2/2 © Copyright 2020 by Pluralsight

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy