LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-23-2020, 09:39 AM   #1
ewpoppy
LQ Newbie
 
Registered: Apr 2020
Location: NC
Distribution: Lite,Mint,Debian
Posts: 10

Rep: Reputation: Disabled
Trying to print list in terminal,print the results,not print from.


example:
hdparm I /dev/hda "how do I print the results?"
tried 'select all' 'save contents'
search provides plenty of print from terminal, but I want to print the results found in terminal.
Thank you for any help.
 
Old 04-23-2020, 11:10 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,678

Rep: Reputation: Disabled
Redirect the command output into a file:
Code:
sudo hdparm -I /dev/hda >hdparm.out
Then print the file.

If the messages you want to print go to stderr, then redirect stderr (file descriptor 2) instead: 2>file

For all the gory details, see Redirections in Bash Reference Manual.

Last edited by shruggy; 04-23-2020 at 11:21 AM.
 
Old 04-23-2020, 11:18 AM   #3
ewpoppy
LQ Newbie
 
Registered: Apr 2020
Location: NC
Distribution: Lite,Mint,Debian
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by ewpoppy View Post
example:
hdparm I /dev/hda "how do I print the results?"
tried 'select all' 'save contents'
search provides plenty of print from terminal, but I want to print the results found in terminal.
Thank you for any help.
Can mark as solved, example:
sudo hdparm -I /dev/sda > /home/linuxlite/hdparm
Problem was folder hdparm permission. Had to list others as read/write.
Fixed the problem.Who ever made Gnote has saved me a lot of typing.Testing problems i do a lot of copy/paste.
Thank all of you at linuxquestions. IF NOT FOR YOU PEOPLE, MYSELF AND OTHERS WOULD INSTALL AN OS. GET CONFUSED AND DELETE IT.
YOU MAKE LINUX WORTH MY TIME TO LEARN. THANK YOU.ewl
 
Old 04-23-2020, 03:02 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Quote:
Originally Posted by ewpoppy View Post
Can mark as solved
You can mark as solved, using the Thread Tools at the top of the page.
 
1 members found this post helpful.
Old 04-24-2020, 07:33 AM   #5
ewpoppy
LQ Newbie
 
Registered: Apr 2020
Location: NC
Distribution: Lite,Mint,Debian
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
You can mark as solved, using the Thread Tools at the top of the page.
sudo hdparm -I /dev/sda > /home/linuxlite/hdparm.txt
worked very well,thank you
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Type 'sudo' is not known on line 2 in source list /etc/apt/sources.list.d/signal-xenial.list" jameswilson0609 Linux - Newbie 3 05-29-2019 12:04 PM
E: Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/mono-official.list 221B Linux - Newbie 6 09-07-2017 12:14 PM
[SOLVED] Running batch file does not produce same results as running command from Terminal nmuleski Linux - Newbie 9 12-30-2011 09:52 AM
'E:Malformed line 54 in source list /etc/apt/sources.list (dist parse), E:The list of vsssuccess@gmail.com Linux - Desktop 1 11-17-2010 08:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration