LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-24-2017, 12:42 PM   #1
DexterMorgan
LQ Newbie
 
Registered: Apr 2015
Posts: 13

Rep: Reputation: Disabled
redirect errors to multiple locations


Hi,

I'm wondering if there's a way to run a command and get:

- stderr and stdout goes on screen.
- make a copy of everything on screen, incl stderr,stdout to history.log

- BUT also make seperate logfile containing only errors, errorlog.log.

Something like this:
ls asdf 2>errorlog.log | tee history.log

But the problem here is that the errors does not appear on screen nor in the history.log
 
Old 06-25-2017, 06:42 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Command 2> >(tee -a errorlog.log >&1) |tee -a history.log
 
1 members found this post helpful.
Old 06-27-2017, 09:37 AM   #3
DexterMorgan
LQ Newbie
 
Registered: Apr 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
Command 2> >(tee -a errorlog.log >&1) |tee -a history.log
Thank you! this was absolutely beautiful.
 
  


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
mount media to multiple locations pauld Linux - Software 5 01-17-2012 08:07 AM
DNS at multiple locations winblowzxp Linux - Server 2 01-13-2011 07:21 PM
How to remove multiple directories in different locations CHARL0TTE Linux - Newbie 9 03-25-2010 07:20 PM
Redirecting output to multiple locations? SirTristan Linux - Newbie 6 05-29-2008 03:52 PM
mount same device at multiple locations merlin23 Linux - Newbie 2 12-06-2004 07:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:24 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