Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to save the errors when I do a chmod to a file. I am running the command:

chmod -R 766 * > chmod-errors.txt

But that does not work. I also tried

chmod -R 766 * | cat > chmod-errors.txt

What am I doing wrong?

share|improve this question
up vote 5 down vote accepted

You are redirecting the standard output of the command, not the error output. You need to redirect the error output to the file.

chmod -R 766 * 2> chmod-errors.txt
share|improve this answer
    
+1 Simple, clean and...right! :D – dag729 Jun 29 '10 at 22:52
1  
mywiki.wooledge.org/BashFAQ/055 For more reference material and a detailed explanation. – Nitrodist Jun 29 '10 at 22:56
    
Thanks @honk, worked great. And thanks @Nitrodist for the background info! I appreciate it VERY much! – artlung Jun 29 '10 at 23:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .