2

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'.

Thanks

Alamri
  • 125

2 Answers2

2

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.

notkevin
  • 731
  • 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
1

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)

matv1
  • 756
  • 2
    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
  • 1
    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
  • lol, touche, but that is this particular user. Others that have this question may not be quite as savvy. – TrailRider Feb 24 '13 at 16:41
  • @TrailRider Still have a point ^^, and thank you matv1 for the helpful solution. – Alamri Feb 24 '13 at 21:54