List directory (ls): Show file size output separated by commas
Posted: 3/30/2021 5:42:58 PM
By: PrintableKanjiEmblem
Times Read: 1,559
0 Dislikes: 0
Topic: Linux

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

Enjoy!

PS: This also works with du

Rating: (You must be logged in to vote)