[X4U] Command to get permissions of a single item?

Jerry Krinock jerry at ieee.org
Mon Oct 30 16:29:04 PST 2006


For a shell script I'm writing.  I need a command which will get the
permissions, either as a string or an octal number, for a single item
(directory, regular file, or symlink).

I thought this would be easy, but after an hour of searching I can't find
such a thing.  The only command I can find for reading permissions is "ls",
but of course that gives it for ITEMS IN the subject, which must be a
directory.

Isn't there a non-recursive command to simply "get item's permissions",
(and/or other metadata)?

We have chmod to CHANGE the permissions, but how can we READ them?

Jerry Krinock




More information about the X4U mailing list