I am looking for a command that will return the owner of a directory and only that--such as a regex parsing the ls -lat command or something similar? I want to use the result in another script.
|
|
||||
|
|
|
Unfortunately, there are a number of versions of
If portability is a concern, you're probably better off using Gilles's suggestion of combining
|
|||||||||
|
|
Parsing the output of
Another option is to use a Note that testing whether a given user is the owner is a different proposition.
|
||||
|
|
|
One can also do this with GNU find:
This isn't portable outside of the GNU system, but I'd be surprised to find a Linux distribution where it doesn't work. |
|||
