Review your favorite Linux distribution.
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 04-19-2010, 11:37 AM   #1
Senior Member
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,031

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
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

Rep: Reputation: 41
I found this - -, hope this is it.
Old 04-19-2010, 11:51 AM   #3
Registered: Aug 2009
Location: Virginia, United States
Distribution: openSUSE 11.2 KDE
Posts: 34

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

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

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

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
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 553

Rep: Reputation: 116Reputation: 116
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
Senior Member
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,064

Rep: Reputation: 894Reputation: 894Reputation: 894Reputation: 894Reputation: 894Reputation: 894Reputation: 894
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...


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 > Forums > Linux Forums > Linux - Newbie

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

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