[SOLVED] Saving Terminal Output?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Pepmint
Level 1
Level 1
Posts: 41
Joined: Wed Jul 23, 2014 5:35 am

[SOLVED] Saving Terminal Output?

Post by Pepmint » Tue Jul 11, 2017 4:28 am

Did this by copying and pasting into LibreOffice. Colors are lost and the fonts seems to be nearly the same, as you see here:
@m-hp ~ $ inxi -s
Sensors: System Temperatures: cpu: 29.8C mobo: 27.8C gpu: 48.0
Fan Speeds (in rpm): cpu: N/A
Drives: HDD Total Size: 1223.6GB (6.3% used) ID-1: /dev/sda model: Samsung_SSD_840 size: 128.0GB
ID-2: /dev/sdb model: TOSHIBA_DT01ACA1 size: 1000.2GB ID-3: USB /dev/sdc model: Extreme size: 31.4GB
ID-4: USB /dev/sde model: Extreme size: 64.0GB
Simply saving the terminal output seems to be impossible?
Last edited by Pepmint on Sun Jul 16, 2017 1:11 pm, edited 1 time in total.

User avatar
greerd
Level 6
Level 6
Posts: 1058
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Saving Terminal Output?

Post by greerd » Tue Jul 11, 2017 6:17 am

Try re-directing output to a file.

Code: Select all

inxi -c0 -Fxz > testout.txt
Creates a file in the same directory that the terminal is at called testout.txt. The -c0 removes any color tags.

User avatar
Flemur
Level 17
Level 17
Posts: 7307
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Saving Terminal Output?

Post by Flemur » Tue Jul 11, 2017 9:50 am

Pepmint wrote:Did this by copying and pasting into LibreOffice. Colors are lost and the fonts seems to be nearly the same, as you see here:
When you do the "command > file", it doesn't save the font, and the color-codes (Looks like: ^[[1;34mCPU^[...") can be stuck in the output file if you don't do the "-c0" @greerd

You can also let the output go to the terminal, then select/hilight the output, copy->paste into text editor.
To copy from a terminal: Shift+Ctrl+C or Rt-click->menu.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

Pepmint
Level 1
Level 1
Posts: 41
Joined: Wed Jul 23, 2014 5:35 am

Re: Saving Terminal Output?

Post by Pepmint » Thu Jul 13, 2017 8:33 am

Perhaps I put it the wrong way: Intention is, e.g. after writing "inxi -F", to save the result exactly the same way it is printed on the terminal. Because, for later reference, it is easy to read instead having it saved as mentioned. Btw: I could not find "Solved" via "Edit" - where is it?

User avatar
gold_finger
Level 9
Level 9
Posts: 2886
Joined: Mon Mar 11, 2013 11:39 pm

Re: Saving Terminal Output?

Post by gold_finger » Thu Jul 13, 2017 9:06 am

Pepmint wrote:Btw: I could not find "Solved" via "Edit" - where is it?
It's not a pre-set option available to add, you need to type it into title of post yourself.

Hit "Edit" button on first post of this thread, then type <SOLVED> at beginning of the original title/subject line of post.
Please add [SOLVED] to your thread if a solution is found. Go to your first post in the thread, hit "Edit" button and add [SOLVED] to the title of the post.

How To Format Your Forum Posts.

Try Linux Beginner Search Engine for Linux questions.

User avatar
Spearmint2
Level 16
Level 16
Posts: 6875
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: Saving Terminal Output?

Post by Spearmint2 » Thu Jul 13, 2017 11:20 am

Pepmint wrote:Perhaps I put it the wrong way: Intention is, e.g. after writing "inxi -F", to save the result exactly the same way it is printed on the terminal. Because, for later reference, it is easy to read instead having it saved as mentioned. Btw: I could not find "Solved" via "Edit" - where is it?
The only way to do what you want is to screenshot it and save that to a file.
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....

User avatar
karlchen
Level 20
Level 20
Posts: 11402
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Saving Terminal Output?

Post by karlchen » Thu Jul 13, 2017 11:51 am

Hello, Pepmint.
Pepmint wrote:Intention is, e.g. after writing "inxi -F", to save the result exactly the same way it is printed on the terminal.
I think it has been mentioned before, it can be done like this:

Code: Select all

inxi -F > /path/to/inxi_report.txt
Later on you can view the inxi report by executing

Code: Select all

cat /path/to/inxi_report.txt
Simply try.

Note:
Replace /path/to by the directory name where you want to save the the inxi report / where you have saved it.

Best regards,
Karl
Image
Linux Mint 19.2 32-bit xfce Desktop, Total Commander 9.22a 32-bit
Haß gleicht einer Krankheit, dem Miserere, wo man vorne herausgibt, was eigentlich hinten wegsollte. (Goethe)

Pepmint
Level 1
Level 1
Posts: 41
Joined: Wed Jul 23, 2014 5:35 am

Re: [SOLVED] Saving Terminal Output?

Post by Pepmint » Tue Jul 18, 2017 4:38 am

What karlchen wrote worked! Today I got this terminal output:

Code: Select all

 ~ $ sudo dkms install -m rtl8812AU -v5
Error!  Unknown option: -v5
Usage: /usr/sbin/dkms [action] [options]
  [action]  = { add | remove | build | install | uninstall | match | autoinstall
               | mkdriverdisk | mktarball | ldtarball | mkrpm | mkkmp | mkdeb | status }
  [options] = [-m module] [-v module-version] [-k kernel-version] [-a arch]
              [-d distro] [-c dkms.conf-location] [-q] [--force] [--all]
              [--templatekernel=kernel] [--directive='cli-directive=cli-value']
              [--config=kernel-.config-location] [--archive=tarball-location]
              [--kernelsourcedir=source-location] [--no-prepare-kernel] [--no-initrd]
              [--binaries-only] [--source-only] [-r release (SuSE)] [--verbose]
              [--size] [--spec=specfile] [--media=floppy|iso|tar] [--legacy-postinst=0|1]
m@m-HP ~ $ uname -r
4.8.0-58-generic
Then I wanted to save it, it was not intended before, because of the "Error" I want to save it, though. Now, it seems, the method, karlchen posted, will not work. How could I save this output, so it is exactly the same as in the terminal?

Post Reply

Return to “Newbie Questions”