Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Human readable ls command for AIX 1

Status
Not open for further replies.

jhoward1

Technical User
Jan 21, 2009
1
US
In AIX, I can get human readable versions of the df command: df -g or df -m to work properly but I really miss ls -h for human readable ls command.

Is there any way to get this to work? Or must we always revert to doing math where the ls command is concerned? Thanks in advance for any help...
 
I hope this helps:

Code:
ls -al | awk '{ print $1, $2, $3, $4, (($5/1048576))"\t", $6, $7, $8, $9 }'

This will display the output in Megabyte to display in KB:

Code:
ls -al | awk '{ print $1, $2, $3, $4, (($5/1024))"\t", $6, $7, $8, $9 }'

Regards,
Khalid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top