Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I get human-readable ls output under AIX? There is no -h parameter

share|improve this question
2  
What is there in the ls output that isn't human-readable? –  MaxMackie Aug 30 '11 at 15:16
    
To other readers: ls -lh converts sizes into kilobytes, megabytes and gigabytes. –  Steve-o Aug 31 '11 at 6:27

3 Answers 3

up vote 3 down vote accepted

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
share|improve this answer

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.

share|improve this answer

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.