Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get latest 100MB Of text file in linux

How do I get the latest 100MB from a text log on Linux? Is there a tool for it, or could you point me on a script?

I have no programming experience on Shell Scripting, Perl or Python, and I don't want to install mono so I can write it in C#.

Thanks!!

Yvan Janssens

like image 399
friedkiwi Avatar asked Sep 09 '10 19:09

friedkiwi


People also ask

How do I find large text files in Linux?

You can start Midnight Commander from the CLI with the mc command. After that you may select and open any file in "view mode" ( F3 ) or in "edit mode" ( F4 ). mc is much more efficient when opening and browsing large files than vim .

How do I get the last n lines of a file in Linux?

To look at the last few lines of a file, use the tail command. tail works the same way as head: type tail and the filename to see the last 10 lines of that file, or type tail -number filename to see the last number lines of the file.


1 Answers

You can try this :

tail -c 104857600 yourFile

or if you're more confortable:

tail -c $[1024*1024*100] yourFile

Resources :

  • linux.die.net - tail
like image 70
Colin Hebert Avatar answered Sep 23 '22 13:09

Colin Hebert