Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to find owner of file or folder?



On Mon, Feb 27, 2012 at 11:55:14AM -0500, TJ Luoma wrote:

> This is the only way that I know of to get the username who owns a
> certain file or folder, such as /usr/local/
> 
>           command ls -ld /usr/local | awk '{print $3}'
> 
> (or `ls -dn` if you want the number instead of the name)
> 
> but that seems fairly inelegant.
> 
> Is there a better way?

The stat builtin, from the zsh/stat module (see zshmodules(1).  Or the
similar utility of the same name, part of GNU coreutils.

Danek



Messages sorted by: Reverse Date, Date, Thread, Author