Quick question about finding a large file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Quick question about finding a large file
# 1  
Old 10-17-2008
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?
# 2  
Old 10-17-2008
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  
Old 10-17-2008
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  
Old 10-17-2008
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  
Old 10-19-2008
#find / -xdev -size +100000 -exec ls -l {} \; | sort +4n | more
# 6  
Old 10-19-2008
Another one without using sort...

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

# 7  
Old 10-19-2008
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.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Quick way to select many records from a large file

I have a file, named records.txt, containing large number of records, around 0.5 million records in format below: 28433005 1 1 3 2 2 2 2 2 2 2 2 2 2 2 28433004 0 2 3 2 2 2 2 2 2 1 2 2 2 2 ... Another file is a key file, named key.txt, which is the list of some numbers in the first column of... (5 Replies)
Discussion started by: zenongz
5 Replies

2. Shell Programming and Scripting

Quick question about finding the PID of long-running processes

The end result that I'd like is to terminate any process on my ps -u username list that extends beyond 20 minutes. I know for a fact that this process will be named l.exe, but I don't know the number in between and I won't know the PID. Is there a way to use grep or pidof to do this task every 20... (2 Replies)
Discussion started by: Bolanok
2 Replies

3. Shell Programming and Scripting

Finding data in large no. of files

I need to find some data in a large no. of files. The data is in the following format : VALUE A VALUE B VALUE C VALUE D 10 4 65 1 12 4.5 65.5 2 10.75 5.1 ... (2 Replies)
Discussion started by: cooker97
2 Replies

4. Shell Programming and Scripting

finding and removing patterns in a large list of urls

I have a list of urls for example: Google Google Base Yahoo! Yahoo! Yahoo! Video - It's On Google The problem is that Google and Google are duplicates as are Yahoo! and Yahoo!. I'm needing to find these conical www duplicates and append the text "DUP#" in from of both Google and... (3 Replies)
Discussion started by: totus
3 Replies

5. UNIX Desktop Questions & Answers

Quick if file exist question...

What does the "!" do in the second statement? Is kinda strange but sometimes one or the other works. rsakey="~/.ssh/id_rsa.pub" if ;then if ;then (1 Reply)
Discussion started by: elbombillo
1 Replies

6. UNIX for Dummies Questions & Answers

Quick question

Hi, Is there a simple way, using ksh, to find the byte position in a file that a stated character appears? Many thanks Helen (2 Replies)
Discussion started by: Bab00shka
2 Replies

7. Shell Programming and Scripting

Ok quick question

Hi i just wanted to know is there anyway to log the keystrokes on a remote computer? For example i let my nieces play on my other computer downstairs *my computer and the one downstairs are on a LAN* and i want to see everything they type in to make sure they arent doing anything they are supposed... (1 Reply)
Discussion started by: Corrail
1 Replies

8. Shell Programming and Scripting

quick question

does anyone know what $? means? i echoed it on my box (running AIX Korn shell) and got 127 (2 Replies)
Discussion started by: penfold
2 Replies

9. UNIX for Dummies Questions & Answers

Quick Question

Hello There! I am trying to write this SIMPLE script in Bourne Shell but I keep on getting syntax errors. Can you see what I am doing wrong? I've done this before but I don't see the difference. I am simply trying to take the day of the week from our system and when the teachers sign on I want... (7 Replies)
Discussion started by: catbad
7 Replies

10. Shell Programming and Scripting

A very quick question

Just a super quick question: how do you put a link in your php code. I want to make a link to something in /tmp directory. i.e. how do you put a href into php, I think it's done a bit differently. thanks john (1 Reply)
Discussion started by: jmg5
1 Replies
Login or Register to Ask a Question