Say I have folder foo residing, the home directory. I want to get some info of it, owner, group, permissions, etc...I then do this to try to get the information:cd ~ls -l fooOf course it now lists the info of the contents of fooThen I could do something like thiscd ~dir=fools -l $foo/.. | awk 'BEGIN { dir='$foo' } { if($9 == dir) { print $0 }  }'But isn't there an easier way to do this?
How can I make ls show information about the directory specified only, not info about its sub-files or folder contents?
directory;ls
Tryls -ld fooAnd you will get what you want. But also consider stat if you want to capture information. The output of ls is for human consumption only.stat -c %U foo # get owner of foo