Is there a shell command to just print the owner of a file?
I guess I could just do:
ls -l | awk '{print $3}'
but this feels like there would be a more straightforward answer to the problem.
Try using stat(1)
[cnicutar@fresh ~]$ stat -c %U file.c
cnicutar
There are lots of format sequences available: user ID, total size, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With