Save Message

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
borgward
Level 6
Level 6
Posts: 1186
Joined: Mon Dec 17, 2012 10:18 pm

Save Message

Post by borgward »

How do I save or print or print to file message from tty1? I am looking at messages because install will not boot. I ran commands from tty1 to find out why. Some messages are very long, up to several hundred pages, too many to write by hand.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Save Message

Post by jimallyn »

You can redirect the messages to a file. For example, if I wanted to have the output of inxi -S saved to the hard drive, I would use inxi -S > inxitest.txt. That would write the output of the command to a text file named inxitest.txt. If I wanted to view that file from the command line, I would use cat inxitest.txt. If there was too much stuff and it scrolled by too quickly, I would use cat inxitest.txt | less. That allows you to page up and down in the file, then hit q to exit. To print the file, use lpr inxitest.txt. The same stuff can be used with pretty much any command.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
AndyMH
Level 21
Level 21
Posts: 13757
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Save Message

Post by AndyMH »

You can also use tee to send output to a file and still have it display on a terminal:

https://stackoverflow.com/questions/418 ... and-stdout
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Save Message

Post by jimallyn »

AndyMH wrote: Sun Jan 13, 2019 6:48 amYou can also use tee to send output to a file and still have it display on a terminal
Cool. I had heard of tee before, but never used it. One of the things I like about Linux is there are multiple ways to do just about anything.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
Locked

Return to “Hardware Support”