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)
This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available in our efforts to advance understanding of environmental, political, human rights, economic, democracy, scientific, and social justice issues, etc. We believe this constitutes a 'fair use' of any such copyrighted material as provided for in section 107 of the US Copyright Law. In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit to those who have expressed a prior interest in receiving the included information for research and educational purposes. For more information go to: . If you wish to use copyrighted material from this site for purposes of your own that go beyond 'fair use', you must obtain permission from the copyright owner.