Hello,
I have a huge (~2GB) file that I need to navigate around. I don't actually need to edit it, just jump around efficiently.
I tried vim but it choked.
Any recommendations for working with huge files on Linux?
Thanks
Hello,
I have a huge (~2GB) file that I need to navigate around. I don't actually need to edit it, just jump around efficiently.
I tried vim but it choked.
Any recommendations for working with huge files on Linux?
Thanks
emacs works very well with files into the 100's of megabytes, I've used it on log files without too much trouble.
But generally when I have some kind of analysis task, I find writing a perl script a better choice.
Vim has a LargeFile plugin for larges files. It will basically configure vim to not use a swap file and undo levels when opening big files (like in Vim Tip 611).
But I think I'd rather use grep
and split
to navigate in such a file (see Grep with large patterns files).
This has been a recurring question for many years. (The numbers keep changing, but the concept is the same: how do I view or edit files that are larger than memory?)
Obviously more
or less
are good approaches to merely reading the files --- less
even offers vi
like keybindings for scrolling and searching.
A Freshmeat search on "large files" suggests that two editors would be particularly suited to your needs.
One would be: lfhex ... a large file hex editor (which depends on Qt). That one, obviously, entails using a GUI.
Another would seem to be suited to console use: hed ... and it claims to have a vim
-like interface (including an ex
mode?).
I'm sure I've seen other editors for Linux/UNIX that were able to page through files without loading their entirety into memory. However, I don't recall any of their names. I'm making this response a "wiki" entry to encourage others to add their links to such editors. (Yes, I am familiar with ways to work around the issue using split
and cat
; but I'm thinking of editors, especially console/curses editors which can dispense with that and save us the time/latencies and disk space overhead that such approaches entail).
I tried to edit a huge file of 7GB with PilotEdit. But it may take you 15 minutes to open/save a 2GB file. After you open the file, you can view/edit it quickly. You may try to open FTP files with PilotEdit.