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.
Find the owner of a directory or file, but only return that and nothing else
shell script;ls
stat  from GNU coreutils can do this:stat -c '%U' /path/of/file/or/directoryUnfortunately, there are a number of versions of stat, and there's not a lot of consistency in their syntax.  For example, on FreeBSD, it would bestat -f '%Su' /path/of/file/or/directoryIf portability is a concern, you're probably better off using Gilles's suggestion of combining ls and awk.  It has to start two processes instead of one, but it has the advantage of using only POSIX-standard functionality:ls -ld /path/of/file/or/directory | awk '{print $3}'