Bash Trick: Display File Sizes in Byte, Kilobyte, Megabyte, Gigabyte

Try this gem to display file sizes in human readable format (374B, 1.1K, 408M, 2.6G) with ‘ls’ from the terminal:

$ ls -ahl
drwxr-xr-x   3 JOHN  staff   102B Aug 18 23:02 MacTweaks.app
-rw-r-----@  1 JOHN  staff    19K Sep 27 21:32 Fubar.png
drwxr-xr-x@  7 JOHN  staff   238M Sep 26  2009 homebrew.pages
-rw-r-----@  1 JOHN  staff   2.6G Oct  2 12:29 xcode_6.1_gm_seed.dmg