a more compact ls -l-->

ls -hog --> a more compact ls -l

ls -hog
I often deal with long file names and the 'ls -l' command leaves very little room for file names. An alternative is to use the -h -o and -g flags (or together, -hog). * The -h flag produces human-readable file size (e.g. 91K instead of 92728) * The -o suppresses the owner column * The -g suppresses the group column Since I use to alias ll='ls -l', I now do alias ll='ls -hog'
Sample Output
$ ls -l
-rwxr-xr-x@  1 hai  staff  24973 Mar 15 22:37 droopy*
-rw-r--r--@  1 hai  staff  92728 Feb 25 22:57 test report.m4a
-rwxr-xr-x   1 hai  staff   6174 Feb  4 18:05 xml.tcl*

$ ls -hog
-rwxr-xr-x@  1     24K Mar 15 22:37 droopy*
-rw-r--r--@  1     91K Feb 25 22:57 test report.m4a
-rwxr-xr-x   1    6.0K Feb  4 18:05 xml.tcl*

By: haivu
2009-03-21 05:24:49

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: