LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-18-2008, 09:23 AM   #16
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116

Quote:
Originally Posted by ghostdog74 View Post
its a mysql database dump. i doubt each line will be 3MB each. I am also curious, if mysql dump is a binary file, then how is OP going to get those lines.
OP specified it was a text file.

Does tail scan the file in place? Or does it load it into memory? A file that big...you can't load into memory.
 
Old 07-18-2008, 10:22 AM   #17
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
well, with a little experiment, we can find out. Its a 300Mb++ file.
Code:
# ls -l file
-rw-r--r-- 1 root root 361380637 Jul 18 10:10 file
# wc -l file
15515859 file
# time more +28271 file > /dev/null

real    0m20.881s
user    0m20.385s
sys     0m0.312s
# time sed '1,28271 d' file > /dev/null

real    1m3.363s
user    1m2.032s
sys     0m0.436s
# time awk 'NR > 28271' file> /dev/null

real    0m12.692s
user    0m12.209s
sys     0m0.400s
# time tail +28271 file > /dev/null

real    0m0.321s
user    0m0.112s
sys     0m0.208s
 
Old 07-18-2008, 01:13 PM   #18
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
tail is definitely looking at it in place I would say.
 
  


Reply



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
Freebsd 6.1 / Install webmin fails (can not fetch file) fatum112 *BSD 1 10-04-2006 06:05 AM
Random file lines directed to a new file. In script an error. In command line no err leventis Programming 1 09-28-2006 07:16 AM
Last 10 lines of a large file loopoo Linux - Newbie 2 05-10-2006 03:01 AM
How can I sort the lines in a file? windhair Linux - Software 2 11-17-2005 08:37 AM
File Fetch service like Europe Online dr_doom Linux - Software 0 04-06-2004 03:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:12 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
Open Source Consulting | Domain Registration