LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices



Reply
 
Search this Thread
Old 04-19-2010, 11:37 AM   #1
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Rep: Reputation: 63
What's the difference between chmod 0755 file and chmod 755 file?


What's the difference between chmod 0755 file and chmod 755 file?
 
Old 04-19-2010, 11:48 AM   #2
rfernandez
Member
 
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

Rep: Reputation: 40
I found this - http://en.wikipedia.org/wiki/Chmod#Special_modes -, hope this is it.
 
Old 04-19-2010, 11:51 AM   #3
Star_Gazer
Member
 
Registered: Aug 2009
Location: Virginia, United States
Distribution: openSUSE 11.2 KDE
Posts: 32

Rep: Reputation: 15
Quote:
Originally Posted by cola View Post
What's the difference between chmod 0755 file and chmod 755 file?
None, since the octal numbers are read from right to left.
 
Old 04-19-2010, 12:19 PM   #4
_Linux_Learner
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 87

Rep: Reputation: 15
There is no difference between 0755 and 755 because by default 755 starts with a zero....

But yes there is a difference between 0755 and 1755.. in later sticky bit is switched on that allow only owner of the resource to delete it...

Hope this helps

Regards
_Linux_Learner
 
Old 04-19-2010, 01:29 PM   #5
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Rep: Reputation: 55
This is the difference...

Code:
0755  --- None of the special bits set
1755  --- Sticky bit set
2755  --- SGID bit set
4755  --- SUID bit set
Google for sticky,SGID and SUID bits.
 
1 members found this post helpful.
Old 04-19-2010, 01:57 PM   #6
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 547

Rep: Reputation: 115Reputation: 115
Yes, but there is no difference between 755 and 0755, regardless of the status of the special bits.
 
Old 04-19-2010, 05:29 PM   #7
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,919

Rep: Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779
If you read the reference by rfernandez you'll see that it makes explicit that 0755 specifies the state of the special bits, where 755 doesn't. Obvious really...
 
  


Reply


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
Accidentally chmod -R 755 * while i was in / Rams3377 Linux - Server 6 04-27-2009 06:39 PM
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 02:10 PM
would you recommend chmod -R 755 *? CodeFish Linux - Security 2 01-22-2005 11:49 PM
chmod 755 won't change file permission. duffboygrim Linux - General 11 04-29-2004 07:17 PM
CGI without having to CHMOD 755 all the time. qistoph Linux - Software 9 06-21-2002 08:30 AM


All times are GMT -5. The time now is 12:33 PM.

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