command output to text file?
Ive installed a package called smartmontools and i am attempting to write the op to a file in my home directory.
With the command $sudo smartctl -a /dev/hda evrything works fine. Its ops the info to the terminal When i type $sudo smartctl -a /dev/hda > /Home It gives me an error... bash: /Home: Permission denied What am i doin wrong? Thanks, meniscus |
/Home is a file called Home in your root (/) directory. You probably aren't allowed to create a file there.
Try $sudo smartctl -a /dev/hda > /home/yourusername/filename HTH |
The syntax that you are using means that you are trying to create a file named Home in the top level directory. Try this instead.
Code:
$sudo smartctl -a /dev/hda > $HOME/smartctl-output.txt |
It worked! Brilliant! Thanks!
Is it possible for me to have that run periodically say every 5 mins without having to write the command in the terminal each time...like a daemon? Can you suggest any tutorials where i might learn how to do this? |
Check man crontab or check the internet for crontab tutorial
|
All times are GMT -5. The time now is 04:58 AM. |