Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.