Linux Tip: Readable ls command

Usually out of habit I just do an ls -la command (or dir by accident 🙂 ):


user@ubuntu:/etc$ ls -la
total 1152
drwxr-xr-x 133 root root 12288 2011-04-03 22:02 .
drwxr-xr-x 22 root root 4096 2010-06-21 12:18 ..
drwxr-xr-x 3 root root 4096 2010-06-21 07:20 acpi
-rw-r--r-- 1 root root 2981 2010-06-21 06:22 adduser.conf
-rw-r--r-- 1 root root 46 2011-01-18 08:54 adjtime
drwxr-xr-x 2 root root 4096 2011-03-06 06:17 alternatives
-rw-r--r-- 1 root root 395 2010-03-04 21:29 anacrontab

If you add -h it becomes human readable for the sizes, which is great:


user@ubuntu:/etc$ ls -lah
total 1.2M
drwxr-xr-x 133 root root 12K 2011-05-19 21:31 .
drwxr-xr-x 22 root root 4.0K 2010-06-21 12:18 ..
drwxr-xr-x 3 root root 4.0K 2010-06-21 07:20 acpi
-rw-r--r-- 1 root root 3.0K 2010-06-21 06:22 adduser.conf
-rw-r--r-- 1 root root 46 2011-01-18 08:54 adjtime
drwxr-xr-x 2 root root 4.0K 2011-03-06 06:17 alternatives
-rw-r--r-- 1 root root 395 2010-03-04 21:29 anacrontab

Also sometimes I like to add -t to sort by time. But usually, ls -la.

Comments are closed.