Tuesday, August 24, 2010

Human-Readable Dired in Emacs

In emacs, dired defaults to

ls -al

format, but I would prefer

ls -alh

For example, I'd rather see this:

total 200M
drwx------ 2 jdm jdm 20K Mar 24 22:00 .
drwxr-xr-x 9 jdm jdm 52K Mar 21 03:04 ..
-rw------- 1 jdm jdm 520K Mar 24 21:03 252.jpg
-rw------- 1 jdm jdm 1.4M Mar 24 21:04 253.jpg
-rw------- 1 jdm jdm 1.3M Mar 24 21:04 254.jpg
-rw------- 1 jdm jdm 1.3M Mar 24 21:05 255.jpg
-rw------- 1 jdm jdm 1.3M Mar 24 21:05 256.jpg
-rw------- 1 jdm jdm 1.1M Mar 24 21:05 257.jpg
-rw------- 1 jdm jdm 1.1M Mar 24 21:06 258.jpg

as opposed to this:

total 204060
drwx------ 2 jdm jdm 20480 Mar 24 22:00 .
drwxr-xr-x 9 jdm jdm 53248 Mar 21 03:04 ..
-rw------- 1 jdm jdm 532078 Mar 24 21:03 252.jpg
-rw------- 1 jdm jdm 1369711 Mar 24 21:04 253.jpg
-rw------- 1 jdm jdm 1285739 Mar 24 21:04 254.jpg
-rw------- 1 jdm jdm 1320355 Mar 24 21:05 255.jpg
-rw------- 1 jdm jdm 1328517 Mar 24 21:05 256.jpg
-rw------- 1 jdm jdm 1101028 Mar 24 21:05 257.jpg
-rw------- 1 jdm jdm 1077152 Mar 24 21:06 258.jpg


The fix was this line of Lisp added to the end of my .emacs file:

(setq dired-listing-switches "-alh")


1 comment:

Boclodoa said...

thank you very much :)