Any way to show the permissions with numbers instead of with letters?
Hi,
any way to show the permissions with numbers (777) instead of with letters (drwxrwxrwx) using "ls" command or any other command ? Regards Javi |
Hi
Not that I'm aware off. It's pretty easy to convert though. Basically think of each triplet (owner is a triplet, group is a triplet and anonymous is a triplet) as an octal number. Then in the triplet you have either a - or one of r, w or x . Think of a - as being a zero and a r, w or x as being a 1. Lastly, in the triplet, each position represents 421 in that order (so r is a 4, w is a 2 and x is a 1); so rwxrwxrwx is basically 421421421 - to convert to the decimal representation you just add the elements of each triplet. Thus a listing like rwxr-xr-x translates into a 755. Kinda tricky but you'll get the hang of it:) |
The output of GNU Coreutils 'stat' can be formated using the '-c' option.
http://www.gnu.org/software/coreutil...tat-invocation Code:
stat -c '%a' file.ext |
All times are GMT -5. The time now is 06:21 AM. |