|
|
ls with octal permissions: single line solution
Hi there,
For those who want to have "0755" style permissions with ls I made this
script:
ls -l | awk
'{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));printf("%0o
",k);print}'
Just type the line above to get the full ls listing with octal + the
drwxr-xr-x style.
If you want to make it permanent, just paste this line into ~/.bashrc
file (and use "l" insted of ls):
alias l="ls -la --color | awk
'{k=0;for(i=0;i<=8;i++)k+=((substr(\$1,i+2,1)~/[rwx]/)*2^(8-i));printf(\"
%0o \",k);print}'"
Cheers,
Mr. Milk
|
|
0
|
|
|
|
Reply
|
internetwalker (1)
|
9/17/2006 7:11:21 AM |
|
|
0 Replies
759 Views
(page loaded in 0.059 seconds)
Similiar Articles: ls with octal permissions: single line solution - comp.unix ...Hi there, For those who want to have "0755" style permissions with ls I made this script: ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/... show numeric (octal) representation of permissions - comp.unix ...ls with octal permissions: single line solution - comp.unix ... show numeric (octal) representation of permissions - comp.unix ..... perl.misc... com> JK> wrote: >> and ... tar: /dev/rmt/0m: Permission denied - comp.unix.solarisls with octal permissions: single line solution - comp.unix ... tar: /dev/rmt/0m: Permission denied - comp.unix.solaris ls with octal permissions: single line solution ... NFS Client hangs on "ls" and other access - comp.unix.solaris ...I ran "truss ls /home/smith" and the last line it shows is: lstat64("/home/smith", 0xFFBFE8A0) (sleeping...) All three boxes are Solaris 10, stock NFS - no tweaking or ... Identifying who owns a write-locked file - comp.unix.solaris ...ls with octal permissions: single line solution - comp.unix ... Identifying who owns a write-locked file - comp.unix.solaris ... ls with octal permissions: single line ... Solaris 8: Cannot rm, chmod, chown, or do anything as Root - comp ...... can't change index-out.html > > # ls -al index-out.html > -rwxr-xr-x 1 ... how to change directory permissions using CHMOD ... single line command to remove a nonempty folder ... Still problem with Sendmail! - comp.unix.solarisCheck permissions and ownership for your queue ... suit root, or > he's using a command-line ... sendmail is setgid to smmsp # ls -l /usr/lib/sendmail -r-xr-sr-x 1 root ... GAWK: A fix for "missing file is a fatal error" - comp.lang.awk ...... 2008 14:48, Kenny McCormack wrote: > Obviously one solution ... null"; else > close(ARGV[2])}1' f1 f2 f3 > f1, line 1 ... it changes how characters are printed (octal vs. %c). NFS Server access list - comp.sys.sun.admin*) Group the machines so that you can use one or more ... ls hangs on listing large NFS mounts - comp.unix ... to ftp to the server, he ... ... to the NFS share permissions ... grep for a "`g'"? (gives an "Unmatched `" err) - comp.unix.solaris ...(please do first try your solutions, if any: this ... oracle.server Or grep those names to : > find the line ... Solaris Operating System: grep octal value (grep '\0145 ... ls with octal permissions: single line solution - comp.unix ...Hi there, For those who want to have "0755" style permissions with ls I made this script: ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/... A command that shows me the permissions of a file in octal ?... command to show me the permissions of a file in octal form ? 'ls ... Just type the line above to get the full ls listing with octal + the ... But the solution given above ... 7/23/2012 7:00:21 AM
|
|
|
|
|
|
|
|
|