I can chown a file with chown myuser:mygroup /tmp/file
, but how can I see who a file is already chowned
to, or who already owns it? Something like chown --show-who
maybe…
How can I list the user and group for a file?
chownprivileges
I can chown a file with chown myuser:mygroup /tmp/file
, but how can I see who a file is already chowned
to, or who already owns it? Something like chown --show-who
maybe…
How can I list the user and group for a file?
Best Answer
A simple
ls -l
would do the trick.The
-l
option to the Unix commandls
will list the files using along format
. In short this displays for each file:Example:
From the FreeBSD ls man page (Linux one is a bit scarce):
The Long Format
To know more:
info ls
on your GNU/Linux system