The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Sort files by date, not showing files from today carlosdivega UNIX for Dummies Questions & Answers 3 07-17-2008 11:37 AM
sort files mita10 UNIX for Dummies Questions & Answers 2 06-12-2008 11:02 AM
sort files by date itik Linux 1 06-02-2008 07:25 PM
Sort and move files subs2me Shell Programming and Scripting 1 01-10-2006 01:52 AM
filesize from a file which has the list of files. yls177 UNIX for Dummies Questions & Answers 3 04-10-2003 12:30 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-19-2008
dbsurf dbsurf is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 23
Sort top 5 files by FileSize

Hi All,

i have one simple question on unix command. I have number files under one directiory and includes sub directories as well. Here, i need to find top 5 files whose sizes are big when compared to other files in ascending or descending order. please note that i need unix command for this requirement. It need to verify in all the sub directories from the current directory.

If anyone answers its appreciated.
  #2 (permalink)  
Old 09-19-2008
Tytalus's Avatar
Tytalus Tytalus is offline Forum Advisor  
echo {1..9}^2\;|bc
  
 

Join Date: Jun 2003
Location: Scotland
Posts: 431
Code:
 find . -exec ls -l {} \; | sort -nr +4 | sed 5q
  #3 (permalink)  
Old 09-19-2008
Tytalus's Avatar
Tytalus Tytalus is offline Forum Advisor  
echo {1..9}^2\;|bc
  
 

Join Date: Jun 2003
Location: Scotland
Posts: 431
or possibly a little cleaner:

Code:
find . -type f -exec du -dok {} \; | sort -nr | sed 5q
  #4 (permalink)  
Old 09-19-2008
dbsurf dbsurf is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 23
can you please explain me clearly about that functionality as i m new to unix?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0