Forum Discussion
hi yes i've just figured out how to use bash
now i want to delete log file contents, ideally var log and free up some space, can you help AaronJB please?
i prefer to use bash but i do not want to disrupt any services
You can pretty safely delete anything in /var/log with a numerical extension like .1 or .2.gz as those are old rotated-out logfiles - if you need to delete any logs which are currently being written to then the best thing is to delete the historical logs and then force log rotation to happen (some help possibly here: https://my.f5.com/manage/s/article/K13367 )
Also have a good look in the following locations for suspiciously large files - I've seen people accidentally record huge pcaps there on more than one occasion:
/config
/root
Also this directory usually holds software images - they can be large and consume a lot of space on small systems:
/shared/images
Searching the entire filesystem for the largest files can also sometimes net good rewards, but it's a slow process:
du -a / | sort -n -r | head -n 20
HTH!