Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-16-2006, 03:56 PM   #1
LQ Newbie
Registered: Mar 2006
Posts: 5

Rep: Reputation: 0
Error results

How do you route error messages to a designated file and folder? Many thanks and if my question is vague its because I suck at linux but I'll try to rephrase if I can. ^^
Old 03-16-2006, 04:10 PM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 166Reputation: 166
You can re-direct error output by using its descriptor, which is '2'. For example, using the find command from the root directory as a user generates errors because users don't have permissions to see all of the directories on the file system. You can re-direct the error messages to /tmp/output.log with:
find / -name dummyfile 2>/tmp/output.log
Or, just stop the errors displaying with:
find / -name dummyfile 2>/dev/null
If you're using bash as your shell, type man bash and search for redirection.
Old 03-16-2006, 04:12 PM   #3
LQ Newbie
Registered: Mar 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you very much for your help!
Old 03-16-2006, 04:12 PM   #4
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
Some programs already have logs for this in /var/log

Otherwise, you can route the output to a file by using a single ">" and the filename or append to file with ">>". Example ls -l > list.txt


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
changing localhost.localdomain results in error DeltaXFX Linux - Networking 4 06-20-2005 07:09 AM
explain results of a df to me mgm36 Linux - Newbie 2 04-28-2005 03:16 PM
ENTRY in .S file results in parse error Dagda99 Programming 9 08-03-2004 04:59 PM
True results of the rm -rf / benjithegreat98 General 6 02-18-2004 11:05 PM
installation or RH9 results w/ fatal region error da_kidd_er Linux - General 1 10-15-2003 08:52 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:16 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration