I host my website at GoDaddy. I have a 9GB log file that I want to delete. I've logged in via SSH as root.
How do I delete the log file?
Filename Size Last modified
birja-vdv.az_access_log 9 GB 2:20 AM
|
Try this command
The answer will be something like
You could then
However, if your web-server is holding the log-file open, the actual file does not get deleted until the web-server closes the log file. You should get the web-server to close and re-open it's log files. With thye Apache webserver you may be able to restart it using a command such as
As Silviu suggests most people prefer to set up something like See StackOverflow Best way to rotate Apache log files I'd check GoDaddy's help pages before proceeding. They are a very big hosting company and will very likely have some easy means for you to manage log files (perhaps through a web control-panel) |
|||||||||||
|
|
Your log files are most likely at Once there, do a file listing ( If cleaning up /var/log doesn't help you (delete enough files), look up what uses most of your hard drive with " |
|||||||||||||
|
|
My guess is that you want to delete your apache log files. Even if you will delete them now, it's good practice to use:
You can check more here. |
|||
|
rm pathtologfile. -1, lack of research effort. Also unclear is why you have a 9GB log file, which might be relevant to the question. And what kind of log file it is. – Daniel Andersson May 15 '12 at 9:37rm birja-vdv.az_access_log– Daniel Andersson May 15 '12 at 9:43man rm. In all frankness, if you don't know how thermcommand works or how you can find out, you should make sure that you know this before starting to delete files on anyone's advise. – Daniel Andersson May 15 '12 at 9:47