Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


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

Rep: Reputation: Disabled
redirect errors to multiple locations


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
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora 33
Posts: 3,598

Rep: Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027
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
LQ Newbie
Registered: Apr 2015
Posts: 13

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:32 PM.

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