Results 1 to 10 of 10
Is it possible for listing directory and files' permission into numbers?
Generally ls command shows directory and files' permission as follows;
[root:maestro:/home/ddisk_net]# ls -al
Total 44
drwx------ 4 ddisk_net users ...
- 07-20-2010 #1Just Joined!
- Join Date
- Sep 2009
- Posts
- 8
[SOLVED] ls permission to numbers?
Is it possible for listing directory and files' permission into numbers?
Generally ls command shows directory and files' permission as follows;
What i want to see is like this;[root:maestro:/home/ddisk_net]# ls -al
Total 44
drwx------ 4 ddisk_net users 4096 7월 20 10:40 .
drwxr-xr-x 21 root root 4096 7월 20 10:28 ..
-rw------- 1 ddisk_net webteam 5 7월 20 10:40 .bash_history
-rw-r--r-- 1 ddisk_net users 33 1월 22 2009 .bash_logout
-rw-r--r-- 1 ddisk_net users 176 1월 22 2009 .bash_profile
-rw-r--r-- 1 ddisk_net users 124 1월 22 2009 .bashrc
-rw-r--r-- 1 ddisk_net users 515 5월 25 2008 .emacs
drwxr-xr-x 3 ddisk_net users 4096 8월 12 2002 .kde
drwx------ 2 ddisk_net webteam 4096 7월 20 11:09 .ssh
-rw-r--r-- 1 ddisk_net users 658 9월 22 2009 .zshrc
Thanks in advance.[root:maestro:/home/ddisk_net]# ls -al
합계 44
700 4 ddisk_net users 4096 7월 20 10:40 .
750 21 root root 4096 7월 20 10:28 ..
600 1 ddisk_net webteam 5 7월 20 10:40 .bash_history
644 1 ddisk_net users 33 1월 22 2009 .bash_logout
644 1 ddisk_net users 176 1월 22 2009 .bash_profile
644 1 ddisk_net users 124 1월 22 2009 .bashrc
644 1 ddisk_net users 515 5월 25 2008 .emacs
750 3 ddisk_net users 4096 8월 12 2002 .kde
700 2 ddisk_net webteam 4096 7월 20 11:09 .ssh
644 1 ddisk_net users 658 9월 22 2009 .zshrc
- 07-20-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
So, you want the permission bits to be displayed in octal format? Sorry, but the 'ls' command won't do that normally (no option for that). However, there is no reason why you can't adapt/modify it to do so by adding a --octal option to the command. If you have a bit of C coding experience, it should not be difficult to modify the 'ls' source code to do that.
Last edited by Rubberman; 07-20-2010 at 02:26 PM.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-20-2010 #3Linux Newbie
- Join Date
- Jul 2007
- Location
- Here. There. Anywhere.
- Posts
- 150
BRILLIANT!!!
...
sorry. The idea excites me, though. Let me know if you're going to try/do this, since I am a slow coder and all, but I think I'll look into making this happen myself.
- 07-20-2010 #4Linux Newbie
- Join Date
- Jul 2007
- Location
- Here. There. Anywhere.
- Posts
- 150
Oh, and just FYI if you don't want to do the C coding/ls modifying, it would probably be even less difficult to write a script to run ls and just modify the permissions column real quick.
- 07-20-2010 #5Just Joined!
- Join Date
- Sep 2009
- Posts
- 8
Rubberman/ I'm very sorry that I'm not a programmer and am a bigginer of linux for many uears...... I ned linux for studying home page, but there are so many things to access terminal and linux console and check permission and ownerships. And I am familiar with numeric permission.
Would you please exlain me how to do this:
why you can't adapt/modify it to do so by adding a --octal option to the command
- 07-20-2010 #6Just Joined!
- Join Date
- Sep 2009
- Posts
- 8
- 07-20-2010 #7Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-20-2010 #8Just Joined!
- Join Date
- Sep 2009
- Posts
- 8
- 07-20-2010 #9Linux Newbie
- Join Date
- Jul 2007
- Location
- Here. There. Anywhere.
- Posts
- 150
PHP _may_ work, but definitely isn't my drug of choice here. Sed/awk seem to be a good choice if you don't have the desire to learn another language like Perl, but I have honestly never used either.
Here (wikipedia) is a direct listing of octal-to-text permissions, which is certainly useful.
And if you do want to pick up Perl, here's where I learned it from: O'Reilly - Safari Books Online: Learning Perl, 3rd Edition
- 07-20-2010 #10Just Joined!
- Join Date
- Sep 2009
- Posts
- 8
ryokimball/
Thanks for your kind reply, and advice.
About learning perl, I'll study later.



