LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 10:37 AM   #1
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,045

Rep: Reputation: 65
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, 10:48 AM   #2
rfernandez
Member
 
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

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

Rep: Reputation: 16
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, 11:19 AM   #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, 12:29 PM   #5
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707

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, 12:57 PM   #6
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

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

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:11 AM.

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
Open Source Consulting | Domain Registration