Sponsored Content
Full Discussion: Ls -al / du
Top Forums Shell Programming and Scripting Ls -al / du Post 302927720 by junior-helper on Friday 5th of December 2014 02:03:42 AM
Old 12-05-2014
Daniel,
is it the output of the find command? I ask this because the biggest file is ~10MB.

You mentioned UNIX 6.1, did you mean AIX 6.1? If so, then try:
Code:
find /opt -type f -size +100000000c -exec ls -l  {} \;

Quote:
Would it be possible to convert the size into MB and then sort them by descending order of the file size?
Yes, the above find command should print files greater than 100000000 bytes (~100MB). Then extend the find command like so
Code:
find /opt -type f -size +100000000c -exec ls -l  {} \; | sort -nrk5,5 | awk '{$5=$5/1024/1024}1'

Sample output (before sort & awk):
Code:
-rw-r-----   1 oracle   dba      104865792 Jan  1 00:00 ./example01.dbf
-rw-r-----   1 oracle   dba      513810432 Jan  1 00:00 ./system01.dbf
-rw-r-----   1 oracle   dba      272637952 Jan  1 00:00 ./sysaux01.dbf

Sample output (after sort & awk):
Code:
-rw-r----- 1 oracle dba 490.008 Jan  1 00:00 ./system01.dbf  # 490 MB
-rw-r----- 1 oracle dba 260.008 Jan  1 00:00 ./sysaux01.dbf  # 260 MB
-rw-r----- 1 oracle dba 100.008 Jan  1 00:00 ./example01.dbf # 100 MB

Hope this helps.
This User Gave Thanks to junior-helper For This Post:
 
All times are GMT -4. The time now is 09:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy