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

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


BEHOLD! Since glogg looks unmaintained klogg is better alternative nowadays

apt install klogg

Try glogg. It worked great for me.

Debian:

apt-get install glogg

Fedora:

yum install glogg


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

apt-get install mc

Red Hat, CentOS, Fedora, etc.:

yum install mc

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:

split -n 8 [FILE_NAME]

The above cammand splits the file into 8 parts.

Of course, this solution will only check for some applications. Note that not every file retains its consistency after the division (e.g. XML does not). It all depends on what you want to do with the given file.