Showing posts with label command line. Show all posts
Showing posts with label command line. Show all posts

Wednesday, June 17, 2009

Remove old files

If you don't use logrotate to remove or archive old logs, here is a way to remove old logs using the -ctime directive within the bash command find.

/usr/bin/find /var/log/tomcat -name *.tgz -ctime +15 | xargs rm -rf

Tuesday, May 27, 2008

Mount a cdrom from the command line

To mount a cdrom (or DVD) from the command line, do the following:

#mount -t iso9660 -o ro <device> <mountedDirectory>

Example:

# mount -t iso9660 -o ro /dev/cdrom /media/cdrom

Note: make sure that /media/cdrom exists.