Share your knowledge at the LQ Wiki.
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 08-06-2010, 04:02 PM   #1
LQ Newbie
Registered: Jul 2010
Posts: 21

Rep: Reputation: 1
Sudo Aureport Redirect output

Hi, All,

How do run aureport as root and redirect it's output to a directory that's only writeable by root?

Ex: sudo -u root aureport > /var/log/
/var/log/ permission denied

/var/log has these permissions:
drwxr-xr-x root root

Old 08-07-2010, 09:26 AM   #2
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
sudo <command> | sudo tee /path/to/file
The output will appear on stdout AND the file. You might want stdout and stderr, in which case:

sudo <command> 2>&1 | sudo tee /path/to/file

Last edited by Meson; 08-07-2010 at 09:31 AM.


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
How to redirect the output of exec command output in perl? sudhap85 Linux - Newbie 3 08-28-2009 04:35 PM
ambiguous redirect when running a script in /root/bin with sudo as normal user chadwick Linux - General 2 06-01-2007 10:57 AM
redirect output to device christina_rules Linux - General 4 05-23-2006 03:46 AM
Redirect output jimwelc Linux - Newbie 3 05-11-2006 12:10 PM
How to redirect output to a file? mus1402 Linux - Newbie 2 02-05-2006 10:42 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:57 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