![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| command to find the files under particular owner | jayaramanit | UNIX for Dummies Questions & Answers | 2 | 08-22-2008 11:08 AM |
| how to extract owner from find command | tjay83 | Shell Programming and Scripting | 5 | 08-12-2008 01:21 AM |
| determine owner of a file | unibboy | Shell Programming and Scripting | 4 | 01-26-2008 11:39 AM |
| Owner of file gets 'not owner' error for chgrp | brizrobbo | SUN Solaris | 4 | 12-18-2007 02:30 PM |
| change owner of a file | CBarraford | UNIX for Dummies Questions & Answers | 3 | 03-03-2007 08:37 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is there a command to get the owner of a file?
At the moment I'm just using `ls -o` (with `cut`), but `ls` is obviously giving me a lot more output than just the file owner.
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Try the stat command:
Code:
stat -c %U file |
|
#3
|
|||
|
|||
|
Thanks a lot, I didn't know about the `stat` command, but I was sure something like this must exist. The operators of the official Ubuntu support channel told me that parsing `ls` was the only way, haha.
|
|
#4
|
|||
|
|||
|
Quote:
|
|
#5
|
|||
|
|||
|
Well yes, I get the impression that people actually know what they're talking about here and are not in the habit of spreading misinformation.
|
|
#6
|
|||
|
|||
|
fyi - the stat command is not standard and does not exist on all UNIX variants. for example - AIX uses the istat command.
|
|
#7
|
|||
|
|||
|
Well yes I had noticed that it resided in /usr/bin.
|
|||
| Google The UNIX and Linux Forums |