Human-readable ls output under AIX?
41,629
Solution 1
Might I suggest ls -ls
?
That will provide the files sizes in KB instead of the default blocks.
Ex:
36 -rw-r--r-- 1 oracle dba 33875 Feb 2 2011 step2.log
32 -rw-r--r-- 1 oracle dba 30308 Feb 2 2011 step2.sql
Solution 2
You can use du. It does not have -h option, but it has -k -m and -g:
$ du -m /tmp/*
4.84 /tmp/diagSEgenSnap
33.12 /tmp/fwupdate
$ du -k /tmp/*
4952 /tmp/diagSEgenSnap
33920 /tmp/fwupdate
Solution 3
Try this
ls -l | awk '{$5=sprintf("%.9f GB", $5/1024^3)} 1'
Solution 4
I can't imagine this:
find -maxdepth 1 -ls
being the best solution, but I don't have an AIX. And do you have gnu-find on AIX? If not - I don't know how the output of other finds looks like.
This is gnu-find:
4 7 drwxr-xr-x 115 stefan stefan 6880 Aug 30 12:43 .
247530 0 lrwxrwxrwx 1 stefan stefan 10 Mär 20 2010 ./u1 -> Ubuntu\ One
45706 0 drwxr-xr-x 3 stefan stefan 80 Mai 29 2010 ./.m2
9352 0 drwxr-xr-x 3 stefan stefan 168 Apr 20 16:26 ./.mc
83653 0 drwxr-xr-x 2 stefan stefan 120 Feb 19 2010 ./.qt
82474 0 drwx------ 2 stefan stefan 128 Apr 27 2009 ./PDF
18316 24 -rw-r--r-- 1 stefan stefan 21925 Aug 30 15:42 ./.scala_history
257889 4 -rw------- 1 stefan stefan 230 Mär 18 06:30 ./.gtk-bookmarks
267759 4 -rw-r--r-- 1 stefan stefan 395 Jan 2 2011 ./brownies.txt
If you don't have any other option, an alias might be useful.
Solution 5
Colorized ls
for AIX(with Perl). Works for most flavors of Unix too, like Sun etc.
Related videos on Youtube
Author by
LanceBaynes
Updated on September 18, 2022Comments
-
LanceBaynes almost 2 years
How can I get human-readable
ls
output under AIX? There is no-h
parameter-
n0pe almost 13 yearsWhat is there in the
ls
output that isn't human-readable? -
Steve-o almost 13 yearsTo other readers:
ls -lh
converts sizes into kilobytes, megabytes and gigabytes.
-