View Light

List directory (ls): Show file size output separated by commas

So you do an ls -l, but with extra-large files, you end up with a file size displayed that is nearly unreadable like:

-rwxrwxrwx 1 root root 10113058787 Mar 30 17:39 filename.gz

Saw lots of people coming up with perl scripts and arcane sed command lines to do this.

But, it's already built in with GNU Core Utilities which is in just about any distro of Linux.

ls -l --block-size="'1"

This gives you something much more readable:

-rwxrwxrwx 1 root root 10,113,058,787 Mar 30 17:39 filename.gz


PS: This also works with du

Rating: (You must be logged in to vote)