LinuxQuestions.org
Help answer threads with 0 replies.
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 01-09-2012, 10:06 AM   #1
ggalan
Member
 
Registered: Oct 2010
Posts: 57

Rep: Reputation: 0
find out chmod of file or directory


is it possible to find out what the chmod number is on a file or directory?
Code:
ls -l
gives me something like this
Code:
drwxr-xr-x
but would like numbers

thanks

Last edited by ggalan; 01-09-2012 at 10:13 AM.
 
Old 01-09-2012, 10:11 AM   #2
Ian John Locke II
Member
 
Registered: Mar 2008
Location: /dev/null
Distribution: Slackware, Android, Slackware64
Posts: 130

Rep: Reputation: 17
Quote:
Originally Posted by ggalan View Post
is it possible to find out what the chmod number is on a file or directory?
Code:
ls -l
gives me something like this
Code:
drwxr-xr-x
but would like numbers

thanks
From
Code:
drwxr-xr-x
it's easy to figure out what the number is. Each
Code:
rwx
is an octet, i.e, those three letters can form a value of no more than 7 and no less than 0. If you know binary then you should know that 100 = 4, 010 = 2, and 001 = 1. Then just think of the following r = 4, w = 2, and x = 1. So for your example, the permissions in numeric form are
Code:
d755
 
1 members found this post helpful.
  


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
[SOLVED] What's the difference between chmod 0755 file and chmod 755 file? cola Linux - Newbie 6 04-19-2010 04:29 PM
a2ps: cannot find file `c0419bt_.afm': No such file or directory rg3 Slackware 5 08-02-2009 03:11 PM
how to apply "chmod g+r" permissions to a deep file and directory structure htamayo Linux - Newbie 3 03-20-2009 03:45 PM
How do i find the biggest file in my directory? anandv_1234 Linux - Newbie 11 12-21-2007 12:58 PM
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 04:23 PM

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

All times are GMT -5. The time now is 02:04 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
Open Source Consulting | Domain Registration