LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-06-2010, 03:02 PM   #1
jaypas
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/test.report
/var/log/test.report permission denied

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

Thanks,
jaypas
 
Old 08-07-2010, 08:26 AM   #2
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
Code:
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:

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

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


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


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