[Linux] saves the terminal command output as a txt text file, linuxtxt
This is not a problem because the Linux terminal is very convenient and can be copied and pasted directly.
Then open a gedit text editor and paste the copied content.
Unlike the windows cmd console, You need to right-click the title bar, select edit-> select all/Tag, right-click the title bar, select copy, and copy.
Cmd is not good, the mouse is a little careless, but also may shake the mouse, the hard-pressed things will disappear.
Of course, the above is only the case that Linux has a graphical interface. If some command line interfaces are not copied and pasted, you need to save a terminal command to a txt text file, you only need to add> Save location, or> Save location after this command. Only ">" is used to overwrite the existing results. Each Command result overwrites the existing txt file. To save many command results, you need to create a txt file with different file names. If you only use one txt file and want to append the cmd command result to the same txt file, replace ">" with ">, this command is also available in Windows cmd, such:
ping > f:\1.txt
Output the description of the ping command to f: \ 1.txt, as shown in:
Using> output Command run results is definitely okay in Linux, but if you use> to output command instructions like above, for example in Linux, enter:
ping > 1.txt
Which is beyond the control of the pingcommand. For example, the result 1.txt is created, but the result is empty:
cat 1.txt
Print 1.txt without any characters.
By default, you are a master in Linux.
In this case, you can use the script command to explain the ping command in Linux.
For example, use
script -a 1.txt
Set all the content of the connected terminal to the 1.txt file and display the result on the terminal. Know that you entered:
exit
So far. In this way, some characters in the printed text file are directly opened in the graphical gedit and cannot be displayed normally.
cat 1.txt
No garbled characters are found.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.