Guest User

Untitled

a guest
Dec 13th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. # Delete files older then 5 days
  2. find /u01/app/oracle/diag/rdbms/firds/FIRDS/trace/* -mtime +5 -exec rm {} \;
  3.  
  4. # Redirect output as sudo user
  5. #1 Run a shell with sudo and give the command to it by using the -c option:
  6. sudo sh -c 'ls -hal /root/ > /root/test.out'
  7. #2 Use sudo tee (if you have to escape a lot when using the -c option):
  8. sudo ls -hal /root/ | sudo tee /root/test.out > /dev/null
Add Comment
Please, Sign In to add comment