[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Working with permissions



Bob McClure Jr wrote:

On Sat, May 31, 2003 at 04:10:21PM -0400, Ian Dixon wrote:


I don't know if this is standard, but on my system, (RH8.0) permissions are shown in mnemonic format. Is it possible to display permissions in an octal format as the default? If this can be done what command would be issued to enable a display change between the two?



I presume you are referencing the "ls -l" command. I did a "man ls" (man is your friend) and didn't find any way to change the

drwxrwxrwx

format of the first field of "ls -l" output.



Thanks to anyone that can help with my further linux education :-)
Ian



I take it you are familiar with octal:


drwxrwxrwx
|| || ||_|__ Others permissions
|| ||_|_____ Group permissions
||_|________ User (owner) permissions
|___________ directory (or symlink or char or block identifier)

In each triplet of permissions, the coding to octal is

rwx
|||___ execute value of 1
||____ write   value of 2
|_____ read    value of 4

So "rw-" is 6, "r--" is 4, "r-x" is 5, etc. So my home directory:

drwx--x--x 180 bob bob 12288 May 31 17:31 .

has permissions (ignoring directory bit) 711. See also

info chmod

Info is also your friend.

BTW, "ll" also works like "ls -l".  And because of my history with
Xenix, I have my own alias of "l" for "ls -l" because I use it a lot.

Cheers,


Thanks Bob,
I am aware of both formats, I just wondered if you were able to display one
or the other as default when running a ls -l command of a file, so that I might
see 664 displayed rather than -rw-rw-r-- every time I looked at a files or
directories permissions. I see that it is not possible and appreciate your help
as always.


Kind regards,
Ian





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]