The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sorting problem.... jarod004 HP-UX 4 06-25-2007 01:42 AM
sorting/arrangement problem Abhishek Ghose Shell Programming and Scripting 7 05-25-2007 10:19 AM
Sorting/Filed Defining/Output problem TiredOrangeCat Shell Programming and Scripting 1 02-12-2007 12:41 AM
Sorting problem "sort -k 16,29 sample.txt > output.txt" ganapati Shell Programming and Scripting 3 08-01-2006 06:55 AM
Problem in sorting the file vishnu_vaka Shell Programming and Scripting 1 12-04-2005 11:47 AM

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 07-31-2007
cool4naren cool4naren is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 3
Haiiiiiiiiii sorting problem in unix

Hai ,

In unix we are going to sort it out all the directories and files based on size of the file. For that we have to use this command ls –al | sort
+4nr. If we are giving this command means it will show all the records in a descending order….when I am checking one file bytes its showing 96 bytes……But I checked inside that file its having so many sub files and sub directories.Its showing 10000 bytes like that. There is a mush difference between this..Now I waana sort out files based on actual size of all directories and files….
  #2 (permalink)  
Old 07-31-2007
cool4naren cool4naren is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 3
Sorting problem

--------------------------------------------------------------------------------

Hai ,

In unix we are going to sort it out all the directories and files based on size of the file. For that we have to use this command ls –al | sort
+4nr. If we are giving this command means it will show all the records in a descending order….when I am checking one file bytes its showing 96 bytes……But I checked inside that file its having so many sub files and sub directories.Its showing 10000 bytes like that. There is a mush difference between this..Now I waana sort out files based on actual size of all directories and files….
  #3 (permalink)  
Old 07-31-2007
matrixmadhan matrixmadhan is online now Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958
how about this !


Code:
find . -name '*.*' -print | xargs ls -l | sort +4nr

  #4 (permalink)  
Old 07-31-2007
cool4naren cool4naren is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 3
Nope this is also giving the same result

Hai friend
This is also giving a same result what ever I used command ls -al | sort +4nr.......My problem is its not sorting out all the sub files and sub directories .When its sorting that file size is different and when I am entering in to that file that file size is different. That sorted file size is not a actual file size......................please help me friends...............
  #5 (permalink)  
Old 07-31-2007
jgt jgt is offline
Registered User
  
 

Join Date: Apr 2007
Location: 44.21.48N 80.50.15W
Posts: 452
Try:

du -a |sort -r -n
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 09:59 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