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



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 !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 2.00 average. Display Modes
  #1 (permalink)  
Old 10-17-2008
Registered User
 

Join Date: Oct 2008
Posts: 27
Quick question about finding a large file

what is the correct command for finding the largest file and displaying it without any error information?

I can find it, but how do I display it in the same command?
Sponsored Links
  #2 (permalink)  
Old 10-17-2008
Registered User
 

Join Date: Aug 2008
Location: Portugal
Posts: 244
You want to display the file on the screen? Like 'cat/less/more file'? It would help if you post the command you're using. Anyway, If you have a command outputting the biggest file, just your-command | xargs cat
  #3 (permalink)  
Old 10-17-2008
Registered User
 

Join Date: Oct 2008
Posts: 27
it doesn't matter which command, I just want to find and display the contents of the biggest file without any other information.

cat, ls, find, more, or less aren't exactly doing that with | xarg cat
  #4 (permalink)  
Old 10-17-2008
RahulJoshi's Avatar
Registered User
 

Join Date: Aug 2008
Location: PUNE
Posts: 98
use this code in ur desire dir :-


Code:
 
 more `find . -type f -exec du -a {} \;|grep -v '\/.*\/'|sort -n|tail -1|awk '{print $2}'`

  #5 (permalink)  
Old 10-19-2008
Registered User
 

Join Date: Jun 2008
Posts: 49
#find / -xdev -size +100000 -exec ls -l {} \; | sort +4n | more
  #6 (permalink)  
Old 10-19-2008
dennis.jacob's Avatar
dj - the student
 

Join Date: Feb 2007
Location: Singapore/Cochin
Posts: 818
Another one without using sort...


Code:
find -name "*" -type f | xargs ls -ltrS | awk 'END{ print $NF }' | xargs cat

  #7 (permalink)  
Old 10-19-2008
Registered User
 

Join Date: Oct 2008
Posts: 27
I figured finding and displaying the largest file on the system would be a small and simple command that actually finds and displays only the largest file on the system.
Sponsored Links
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 Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
quick question keith.m AIX 5 12-21-2006 09:27 AM
quick sed question vbm Shell Programming and Scripting 2 11-09-2006 10:44 PM
Quick question JohnnyBoy UNIX for Dummies Questions & Answers 2 11-03-2006 08:23 AM
quick question penfold Shell Programming and Scripting 2 03-18-2005 06:15 AM
Quick Question Tracy Hunt UNIX for Dummies Questions & Answers 3 02-20-2001 04:20 PM



All times are GMT -4. The time now is 09:51 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-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0