Linux edit large file

Edit large files on Linux

One of our readers requested a list of editors on Linux capable of editing huge files in the order of GBs. In one of our earlier articles we explored some commands to create huge files on Linux. We also visited glogg, a log viewer with similar capabilities but it cannot edit files. Here’s a list of some robust editors.

1. lfhex

A Qt based GUI editor. Can view and edit files in hex, octal, binary, or ascii text mode. Can work with files much larger than system RAM or even address space.

Features

  • Low memory usage
  • Instant load times
  • Instant save times
  • Infinite undo/redo
  • Dynamic hex/octal/binary/ascii editing mode
  • Search
  • “Goto” field for jumping to a specified offset (offset can be specified by a mathematical expression: 0xff*3
  • 64 bit offset support
  • Dynamic resize support
  • Conversion dialog
    > Linked to selection
    > Shows conversion to int, float, double, ascii, hex
    > Modifying int/float/double/ascii/hex updates all the other fields
    > Option to show/edit byteswapped values
  • Binary comparison dialog
    > Differences can be walked by “block”
    > A block can be from 1-16 bytes long
    > Starting offset can be different in each file
  • Minimal dependencies (just Qt)

Limitations

  • Does not support insertion/deletion (cannot change file size)
  • Search/compare can be slow (compared to cmp or any other non-paged IO app)
  • Cannot search files with unsaved modifications

To install on Ubuntu:

2. Joe

Joe s a very powerful full-featured terminal editor. Written in C and the only dependency is libc.

Features

  • Can view and edit files in text of hex mode
  • Supports UTF8 characters
  • Multi-file search and replace- file list is either given on cmdline or by a UNIX command (grep/find) run from within JOE
  • Mouse support, including wheel (works best when using xterm). The mouse can resize windows, scroll windows, select and paste text, and select menu entries.
  • Context display on status line: allows you to see name of function cursor is in
  • Syntax highlighting
  • Swap file allows editing files larger than memory
  • Bash-like TAB completion and history for all prompts
  • Jump to matching delimiter
  • and many more…

Limitations

  • NO vertical windows
  • No folding
  • No background spell checking, like Microsoft WORD
  • Cannot highlight all matching words

To install on Ubuntu:

3. HEd

HEd is a powerful hex editor with a hexdump -C like interface. It can load and edit infinitely large files.

Читайте также:  Где у windows 10 панель обновления

Features

  • Very fast on very large files (keeps only necessary portion of the file in memory)
  • Fast inserting anywhere in the file
  • Fast saving of intermediate changes
  • vim-like controls (and exmode)
  • Powerful expressions concept for flexible searching and transformation operations on the file or a selected region

HEd is not available by default on Ubuntu. Download HEd v0.5 compiled on Ubuntu 14.04 amd64 here.
md5sum: 5eb449e5d613d5925c6ee50ea11ab317

4. LargeFile

This is a plugin available for vim that turns off certain vim features to handle large files. The g:LargeFile (by default 100) option describes the minimum size of a file to be considered as a LargeFile, in megabytes. This option can be set in

Limitation

Note that LargeFile may not be able to handle a 1GB file as it doesn’t change the way vim opens a file.

Installation

Download the latest version from the homepage. Then:

6 thoughts on “Edit large files on Linux”

mcedit from the Midnight Commander is the easiest to use terminal editor and can edit huge files and binary, etc.

Thank you for the input. Will check it out.

From the FEATURES section of mcedit manpages:
“Maximim size of each file is 64 megabytes.”

Источник

How to view huge txt files in Linux? [closed]

Want to improve this question? Update the question so it’s on-topic for Stack Overflow.

Closed 2 years ago .

I have got a 4 GiB txt file that I need to view.

When I try open it in Gedit it loads for a while then crashes.

Have you any ideas of a text editor that I can use to view this file. My OS is Fedora 20.

6 Answers 6

BEHOLD! Since glogg looks unmaintained klogg is better alternative nowadays

Try glogg. It worked great for me.

Not text editors, but in the command line tail -n 100 ./file.txt will give you the last 100 lines of a file, head -n 100 ./file.txt will give you the first 100 lines.

vim in the command line buffers as you read through a file (it doesn’t open it in one go) so it’s quite effective too.

You can install Midnight Commander.

Debian, Ubuntu, etc.:

Red Hat, CentOS, Fedora, etc.:

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 . I checked it myself.

If you want to watch a very large file in your favorite editor, without worrying about the limitations associated with RAM, I suggest you split the file using the split command:

The above cammand splits the file into 8 parts.

Читайте также:  Suse linux enterprise 12 administration lecture book

Источник

Seeking alternative GUI File editor with large file support

Can anyone recommend a file editor, preferably free, that handles large files as well as EmEditor on Windows? I’m on Ubuntu, but other people reading this might not be, so suggestions for other Unix operating systems are welcome, too.

7 Answers 7

Just use gvim , it doesn’t matter for large files, since the editor only reads limited lines to fill the screen, until you scroll down.

In the unix environment there are two major editor you must consider:

And for both there are plugins to improve very large files performance.

Give it a try, you won’t be disappointed.

Another editor to take a look at is hed.

Hed is a free hexadecimal editor for POSIX systems designed to efficiently handle infinitely large files in conjunction with operations like inserting in the middle of the file.

Features

  • Very fast on very large files (keeps only necessary portion of the file in memory)
  • Fast inserting anywhere in the file
  • Fast saving of intermediate changes
  • vim-like controls (and exmode)
  • Powerful expressions concept for flexible searching and transformation operations on the file or a selected region

screenshot

lfhex was written with this in mind. Despite the name, it can edit files in ASCII mode as well as hex.

lfhex is an application for viewing and editing files in hex, octal, binary, or ascii text. The main strength of lfhex is it’s ability to work with files much larger than system memory (or address space for that matter!).

It uses a paging abstraction similar to EmEditor.

lfhex can view files over 4gigs in size (if the OS supports large file offsets). Using a paged i/o abstraction file open times are invariant with file size, a 2gig file opens just as fast as a 2k file.

It’s available in the Ubuntu repos, and probably other distros as well.

Источник

Linux text editor for large text files

I’m looking for a simple and light weight text editor that is capable to open and edit text files from >=2GB quickly and is also capable to process find and replace operations in such files quickly.

Requirements

  • Must run on Linux
  • Must have GUI, no command line only
  • Should neither be Emacs nor VI/M (can’t handle their UI’s)

Already tried, but not appropriate

Any ideas? Thanks. Bunjip.

3 Answers 3

CudaText editor can open/edit big files, up to avail memory size (better use x64 version).

Default max size is 1Gb. To allow max file size of 2Gb, call «Options / Settings-user» and write such option to «user.json»:

Thunderpad (formerly TEXTPAD), is really fast, regarding file size limit It can handle big files easily.

The only downside I see is that it is not clear how big of a file it can handle, it just says «It can handle file sizes up to the largest contiguous chunk of 32-bit virtual memory», I haven’t had a problem with >2gb log file, but it will depend on your hardware/memory/disk structure.

Читайте также:  Установка платформы 1с linux

The problem with editing large files is that if you delete or insert anything, then the file will have to move data around; for example, when you insert a line of text, the editor has to move the lines after it to make room for the new line.

However, if you know what you are doing, you can use a hex editor; it doesn’t move anything, but it lets you overwrite parts of the file, byte by byte. I have used it to edit in the middle of a huge text file (600GB) created by mysqldump .

WARNING Hex editors are very powerful, and you can easily cause irreparable damage, so consider everything you do very carefully, and make sure you understand the structure of the file in sufficient detail.

Источник

Text editor to edit large (4.3 GB) plain text file

Is there any text editor, which can edit such file?

15 Answers 15

Another method is to use split . Split the file into 8 pieces and manipulate the files with a editor. After that, you reassemble the files again.

Try joe. I just used it to edit a

5G SQL dump file. It took about a minute to open the file and a few minutes to save it, with very little use of swap (on a system with 4G RAM).

you will not find them. If you want to replace some lines in this file, you can look at with less or grep and use sed to search and replace some lines.

on Wikipedia are some useful examples: http://en.wikipedia.org/wiki/Sed

Give it a go, if you like, but such big files become impractical if you want to do «normal» editing; eg, you don’t want to go saving your edits too often; it will take too long 🙂

If it’s for a one off, split and join would work quite well, and it is simple enough to chop it up into managable chunks, and then rejoin the pieces. Take note that many editors will add a newline character to the end of your edited file, and do it without informing you! For more info see How to stop Gedit, Gvim, Vim, Nano from adding End-of-File newline char?

Try Gvim if you really want edit such a big file. I’ve just loaded a 3.9GB file into it, and all seems to be normal.

Here is an interesting link on the matter, at stackoverflow

Источник

Оцените статью