![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need help in sort | ali560045 | Shell Programming and Scripting | 2 | 12-04-2007 07:38 AM |
| sort | prasathlogu | UNIX for Dummies Questions & Answers | 1 | 10-08-2007 06:56 AM |
| sort help | unics | Shell Programming and Scripting | 14 | 04-30-2007 07:28 AM |
| How do i sort? | abhijeetkul | Shell Programming and Scripting | 1 | 12-22-2005 03:49 AM |
| 2nd sort key | whatisthis | UNIX for Dummies Questions & Answers | 1 | 10-20-2004 10:46 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I have an approach
du -k |sort -nr > sort_file.txt. The output file will be like this: 3783749 . 5294 ./dir3 4790 ./dir3/dir5/dir1 3088 ./dir8 ... can you help me on how to convert the number from sort_file.txt to MB, GB format, like this: 3.6 GB . 5.2 MB ./dir3 4.7 MB ./dir3/dir5/dir1 3 MB ./dir8 ... Thanks |
|
||||
|
Thank Jean-Pierre,
your script with awk works, but the calculation is not correct. My actual data like this: 126M /openoffice/bin 31M /openoffice/old_versions but it report: 0.1 MB /openoffice/bin 0.0 MB /openoffice/old_versions Could you please correct it! Thank so much! |
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|