LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-07-2012, 07:42 PM   #1
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable, amd64
Posts: 805

Rep: Reputation: 32
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.
 
Old 04-07-2012, 08:06 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,811
Blog Entries: 1

Rep: Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191
Try the following:
Code:
du -a ./*.rar | sort -n -r | head -n 1
 
1 members found this post helpful.
Old 04-08-2012, 01:47 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,251

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Did the above help or were you looking for the largest file inside the archive?
 
Old 04-09-2012, 04:12 AM   #4
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable, amd64
Posts: 805

Original Poster
Rep: Reputation: 32
no, I was looking for largest file inside archive., filtering the output of: rar l archive.rar
 
Old 04-09-2012, 04:40 AM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,251

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
So maybe you can show us where you are stuck? Which rar command are you currently using to examine the archive?
 
1 members found this post helpful.
Old 04-09-2012, 07:39 AM   #6
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable, amd64
Posts: 805

Original Poster
Rep: Reputation: 32
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.

Last edited by qrange; 04-09-2012 at 07:45 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do you find and remove largest file without having to manually type the file name am28 Linux - Newbie 4 11-23-2011 04:45 PM
Find largest file within a directory grob115 Programming 5 09-04-2011 03:35 AM
Command to find largest file. paragkalra Linux - Software 2 11-17-2009 05:36 AM
C++ find array index for largest number. joshp Programming 7 03-15-2009 11:56 AM
Please chech my statement - delete all except file with largest number extension laki47 Linux - Newbie 3 02-20-2009 07:02 AM


All times are GMT -5. The time now is 08:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration