I'm in need of a Bash command or script that will return the group of a file, so that I can store it in a variable.
I'm aware of "ls -g" but that returned:
-rw-r--r-- 1 group 167 Mar 5 11:48 file.txt
A Linux-savvy friend of mine suggested "find file -printf %g" but that command wouldn't work, possibly because I'm using OS X's terminal.
Should I be using Perl, or I am I stuck with some ugly string concatenation?
Thanks for your help!