LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   find largest number in file? (https://www.linuxquestions.org/questions/linux-newbie-8/find-largest-number-in-file-938675/)

qrange 04-07-2012 06:42 PM

find largest number in file?
 
I need to filter output of rar archive listing, to find the largest file in it.
whats the simplest way to do it?
thanks.

sycamorex 04-07-2012 07:06 PM

Try the following:
Code:

du -a ./*.rar | sort -n -r | head -n 1

grail 04-08-2012 12:47 AM

Did the above help or were you looking for the largest file inside the archive?

qrange 04-09-2012 03:12 AM

no, I was looking for largest file inside archive., filtering the output of: rar l archive.rar

grail 04-09-2012 03:40 AM

So maybe you can show us where you are stuck? Which rar command are you currently using to examine the archive?

qrange 04-09-2012 06:39 AM

rar l archive.rar

hmm, it seems that combining it in
Code:

rar l archive.rar | sort -n -r | head -n 1
does the trick, thanks.


All times are GMT -5. The time now is 04:36 PM.