Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change file permissions

Status
Not open for further replies.

call

Technical User
Oct 31, 2000
127
US
I want to get this right. I want this file here to look just like the other file I have under it.
-rw-r----- 1 root system 4729 Oct 15 11:01 security



-rwxr-xr-x 1 digiadm system 4534 Sep 07 2000 security

thank you

 
chown digiadm security
chmod 755 security

All from the directory of the file you want to change.
 
Hi,

for 20 years I have used chmod 755, 644, 777 ...,
and each time I had to think the number in binary
mode to understand if that bit was up or down.

Some years ago, I have discovered, there was from ever,
but I did not know, a way more clear to use chmod:

chmod a+rx file // in the examples above.

You can think the command in "relative mode" instead absolute.
When you say chmod 755, you give the permissions
indipendentely from the previous; many times this is useful.

Other times you want add or revoke permissions for someone.

The syntax is

chmod {what} +|- {what}

{what} can be a combination of
u=user(owner), g=group, o=other, or simply a=all

+|- : + to add, - to revoke

{what} can be a combination of r,w,x

EG:

chmod ug+x file.exe

add executable bit to owner and group. Or


chmod a-w *

protects all file for modify for everyone (also owner)

B Y E
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top