Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a 6 GB text file. It has an access record for a whole month to my website. That file is my only hope to know how a someone got access to my website and hacked it. But, as the file is too big, gedit doesn't open it.

Is there any command or method I could use to read or search in the content of that file?
I tried the following command grep -i '18/jan' 02records but it takes a while and then no results show. I want lines that have '18/jan'.


share|improve this question
Have you tried less or grep? – Karlson Feb 23 '13 at 15:59
yes, i tried grep as you can see in the question :) – Alamri Feb 23 '13 at 18:32
up vote 1 down vote accepted

Hey and welcome to Ubuntu. I think the easiest would be to use the split command in the terminal. Split can take a file and chop it into a bunch of smaller ones. On the commandline just do split then the options you want to use. -b for instance will csplit it into the amount of specified bytes. Gd luck (just google for all the availble options)

share|improve this answer
Could you please expand your answer to include instructions on how to use the split command? Just a command line example should be sufficient. While more advanced users may know what your talking about others may not understand. That will help make your answer helpful to more users and consequently get you more upvotes as well. (Remember we may have new users coming from Windows that have no experience with command lines, if we want to keep them we need to spoon-feed this kind of info or they will get frustrated and leave...) – TrailRider Feb 23 '13 at 16:45
yes please @matv1 can you just explain how to use split, I'm really hopeless right now. all the solutions I'm looking for is just in that text file. – Alamri Feb 23 '13 at 18:36
Yes i got it now, 1st you have to know how many lines we have inside that file using wc -l 02records then we get the lines count, let'us say they are 10000 , so we need to split them to files each one have 2000 lines. So we type split 2000 02records. Now the output files each one should have less than 2000 lines , so we will have 5 splited files. – Alamri Feb 23 '13 at 18:57
Sorry split -l 2000 02records – Alamri Feb 23 '13 at 19:15
@TrailRider Never underestimate the power of an Ubuntu-user ;) – matv1 Feb 24 '13 at 12:11

Assuming that '18/jan' is in the file 02records then your command should have worked. You may want to try a different text editor, like Vi IMproved (vim). It should be able to read a 6GB file.

share|improve this answer
All editors i have used are freeze for a while then forced to close. then i get message from Ubuntu saying that there's no enough memory to send the problem report. – Alamri Feb 23 '13 at 18:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.