Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-19-2003, 05:31 PM   #1
Registered: Dec 2002
Posts: 35

Rep: Reputation: 15
chmod u+s = numeric?

I have a file that needs to be set u+s. I dont know how this translates to numeric values.
I have it set owner is right and 755, is this right?
Old 01-19-2003, 07:49 PM   #2
Registered: Aug 2001
Location: Kingsport, TN
Distribution: RHEL & FC
Posts: 267

Rep: Reputation: 30
Why convert it to a numeric value? You can do just as the example you give: chmod u+s filename works just fine...

+r +w +x +s +???
-r -w -x -s

all valid

Numerically you can take away w from group, add x to other, add s to user and other things all at once in one command where with + and - would take multiple commands.
Old 01-19-2003, 07:49 PM   #3
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Try 4755.
Old 01-19-2003, 10:27 PM   #4
LQ Guru
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 65
To break down the numbers:

1 - read
2 - write
4 - executable

add them together and you get the setting in order of: owner, group, else

So 755 is (1+2+4)owner, 7 who can do all three... group and world only have 5, readable and executable, 1+4.

If you're using a fourth number that first one refers to the sticky bit, a setting of 4 makes it so that the file, when executed, runs as the owner, not the user that executed the file. There are a bunch of stick-bit settings and I don't remember them all, but needless to say a file that is 4777 and is owned by root is a nuclear bomb because anyone can write the file and then execute it as root.


Old 01-19-2003, 11:24 PM   #5
Registered: Dec 2002
Posts: 35

Original Poster
Rep: Reputation: 15
wdingus- so I can understand what I'm doing. I'm used to working w/ numeric values however the docs for the app I'm working w/ are all u+s etc. I dont want to chmod x+x 100 files if they are already chmod'd correctly.

finegan- ahh thanks for the explanation of sticky bit that helps alot. In this case 4755 is owned by the app.

Thanks everyone!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 08:53 PM
Help installing Numeric-23.6 Multra Linux - Newbie 3 10-26-2004 05:14 PM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 05:37 AM
MySQL Numeric Error? nbjayme Programming 9 05-13-2004 07:05 AM
Numeric Permissions MelLinux Linux - General 3 10-18-2002 01:51 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration