LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-16-2006, 03:56 PM   #1
RagedPenguin
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
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
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:
Code:
find / -name dummyfile 2>/tmp/output.log
Or, just stop the errors displaying with:
Code:
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
RagedPenguin
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
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
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

http://www.linuxdevcenter.com/pub/a/...lpt/13_01.html
 
  


Reply


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


All times are GMT -5. The time now is 02:46 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration