There is a file named RESULTS.txt and I want to open this file in my terminal. (I mean I want to see the file contents be displayed in the terminal and not in some text editor)
How do I do that ?
|
There is a file named How do I do that ? |
||||
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer: please explain why you're recommending it as a solution. Answers that don't explain anything will be deleted. See Good Subjective, Bad Subjective for more information. |
||||
|
For short files:
directly shows a text file in the terminal. For longer files:
lets you scroll and search (/ e.g.
|
|||||||||||||||
|
|
Another alternative is
Once you opened a file with vim you can insert text by typing Vim requires some learning, but is widely used and it is very versatile. Check the community help wiki: https://help.ubuntu.com/community/VimHowto
|
|||||||||||||||||||
|
|
If the file is rather long, you might want to use
so that you can navigate through it with directional keys. |
|||||||||||||||||
|
|
all those are best ways and there is one more way to do this & that’s with
and
both will give you the same input. Head command Explanation: Generally head command used to print the starting lines of the any text file.we can view the text file with
That will prints the 1st 10 lines of the above text file. If you want to specific on the number of lines which are to be view then you can use head as
Then in the above text file first 20 lines will be viewed. If you want to view whole file data with head means then then we can get it by
Hope that above explanation will give you some idea on usage of head. |
|||||||||||||||||||||
|
|
Another option:
It will show you the last ten lines of It's useful to see what happens with a server when you use this command on a log file. Press Ctrl-C to quit when you are done viewing. |
|||||
|
|
Another option is:
to print out the last 30 lines of a large file named |
||||
|
|
|
With a terminal text editor: |
||||
|
|
|
There are a lot of alternatives for doing that: Some of these programs have a lot of parameters, so check that out with --help after the command..
Hope that some of this works for you.. |
||||
|
|
|
Lots of good options provided here already, but another option if you need to edit is emacs:
might not need the And in addition to
If you're in bash, you have something similar to
|
||||
|
|
|
As we seem to be listing all available alternatives of displaying any text file in the terminal, it would be quite fun to introduce It is in the repositories and so can be installed with As the man page notes,
With
Needless to say you can increase the rate further ( For more information see |
||||
|
|
|
If you just want to read the file content, go in the file directory and type
If you want to read and edit the text file, from the same directory type
The |
|||||||||
|
|
or just
use hjkl buttons to move line left/down/up/right, Esc then :q to quit and you can PageUp/PageDown you can also edit it here in a stright way here you'll find more link |
|||||||||||
|
|
Another more exotic answer is to use
The |
|||||||||||||||||||
|
|
The shell programm
So
|
||||
|
|
Use gedit, since it is one of the best editor. In gedit you can use mouse for copy,paste,... Vim is vi editor with syntax highliting in color-code. Vim is latest version of the vi editor, which is widely used. |
||||
|
|
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.
cattosedtonanotovim– 2er0 Feb 28 at 0:06