LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error results (https://www.linuxquestions.org/questions/linux-newbie-8/error-results-425498/)

RagedPenguin 03-16-2006 03:56 PM

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. ^^

gilead 03-16-2006 04:10 PM

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.

RagedPenguin 03-16-2006 04:12 PM

Thank you very much for your help! :D

pljvaldez 03-16-2006 04:12 PM

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


All times are GMT -5. The time now is 01:48 AM.