Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Meaning of chmod =rwx

views
     
TSkent05
post Feb 17 2017, 02:57 PM, updated 9y ago

Getting Started
**
Junior Member
183 posts

Joined: Jan 2009
What is the meaning of chmod =rwx?
pufferfish
post Feb 17 2017, 03:03 PM

Casual
***
Junior Member
440 posts

Joined: Oct 2005


rwx = read write execution
chmod = change mode
TSkent05
post Feb 17 2017, 03:54 PM

Getting Started
**
Junior Member
183 posts

Joined: Jan 2009
QUOTE(pufferfish @ Feb 17 2017, 03:03 PM)
rwx = read write execution
chmod = change mode
*
Maybe my question not so clear...I know the meaning of chmod & rwx....chmod go= means to disable rwx to group & others but how about chmod =rwx?
ultramann
post Feb 17 2017, 04:01 PM

New Member
*
Junior Member
37 posts

Joined: Apr 2005
u sure u got the syntax ( chmod =rwx ) right?

refer here.... http://www.computerhope.com/unix/uchmod.htm
TSkent05
post Feb 17 2017, 05:27 PM

Getting Started
**
Junior Member
183 posts

Joined: Jan 2009
QUOTE(ultramann @ Feb 17 2017, 04:01 PM)
u sure u got the syntax ( chmod =rwx ) right?

refer here....  http://www.computerhope.com/unix/uchmod.htm
*
Yup I'm very sure cos I have seen such syntax before. I think I found the answer here...How to Use UNIX and Linux File Permissions
abubin
post Feb 20 2017, 06:58 PM

10k Club
********
All Stars
10,429 posts

Joined: Jan 2003



that tutorial is very well written. If you have problem understanding that then you will have problem learning linux.

Already stated:
CODE

Setting Permissions Without Specifying u, g, o, or a

Permissions are set for user, group, and other if u, g, o, or a are not specified, but your umask (user file-creation mask) comes into play which makes things complicated. The most common umask is 022 which means that when you create a new directory the permissions are not the default of 777 ( drwxrwxrwx) but rather 777 – 022 which is 755 ( drwxr-xr-x). And when you create a new file, the permissions are not the default 666 ( -rw-rw-rw-) but rather 666 – 022 which is 644 ( -rw-r–r–).

The following will happen if your umask is the most common umask of 022:

Command (equivalent command using number system) Permissions
chmod =rwx myfile.txt chmod 755 myfile.txt -rwxr-xr-x


You need to read and understand the whole statement. It explain it very well.

TSkent05
post Feb 21 2017, 02:10 PM

Getting Started
**
Junior Member
183 posts

Joined: Jan 2009
QUOTE(abubin @ Feb 20 2017, 06:58 PM)
that tutorial is very well written. If you have problem understanding that then you will have problem learning linux.

Already stated:
CODE

Setting Permissions Without Specifying u, g, o, or a

Permissions are set for user, group, and other if u, g, o, or a are not specified, but your umask (user file-creation mask) comes into play which makes things complicated. The most common umask is 022 which means that when you create a new directory the permissions are not the default of 777 ( drwxrwxrwx) but rather 777 – 022 which is 755 ( drwxr-xr-x). And when you create a new file, the permissions are not the default 666 ( -rw-rw-rw-) but rather 666 – 022 which is 644 ( -rw-r–r–).

The following will happen if your umask is the most common umask of 022:

Command (equivalent command using number system) Permissions
chmod =rwx myfile.txt chmod 755 myfile.txt -rwxr-xr-x


You need to read and understand the whole statement. It explain it very well.
*
My understanding is, if umask is 002 for regular user & chmod =rw, the permission for file would be 666 - 002 = 664 (same as default permission 666 - 002 = 664)
and directory also be 660 -002 =664 instead of 777 - 002=775.

Correct me if I'm wrong.

This post has been edited by kent05: Feb 21 2017, 06:50 PM
abubin
post Feb 21 2017, 06:36 PM

10k Club
********
All Stars
10,429 posts

Joined: Jan 2003



yeah you got the concept right.

but your calculations is off.

how can 660 -002 =664?

I think it should still be 660.

This post has been edited by abubin: Feb 21 2017, 06:40 PM
TSkent05
post Feb 21 2017, 06:52 PM

Getting Started
**
Junior Member
183 posts

Joined: Jan 2009
QUOTE(abubin @ Feb 21 2017, 06:36 PM)
yeah you got the concept right.

but your calculations is off.

how can 660 -002 =664?

I think it should still be 660.
*
My mistake. It should be 666-002=664.
MatQuasar
post Aug 2 2023, 09:18 PM

Casual
***
Validating
329 posts

Joined: Jun 2023
It is very common also to make a file executable, like:
CODE

chmod +x myapp.bin


...where myapp.bin is a binary file but not set permission to execute.

 

Change to:
| Lo-Fi Version
0.0174sec    0.65    5 queries    GZIP Disabled
Time is now: 25th December 2025 - 01:01 AM