Below are some useful command that I have used in the past and never wrote them down. Then when I need to use them again I have to look them up. If you see any that you think would be nice to have on this list let me know. Find a file in a directory

find /home/bob | grep my_list

Find a word or string of word in a file and list the file path and the string

grep -ri "this is what I an looking for" *

Find all files that have changed in the / in the last 24 hours and print them to a file

find / -mtime -1 \! -type d -print > /tmp/filelist.daily

Find files older than 7 days an ammend them to a file

find /tmp -atime +7 -print >> /tmp/old_files

Find files older than 7 days and delete them

find /pub/data/backups -type f -mtime +7 | xargs -- rm -f --

User tar to back up files contained in a list

tar -cv -T /tmp/filelist.daily -f /mnt/srv3/fri.tar

RPM install with dependency check

rpm -i --nodeps *.rpm

Converting TXT files (removing the ^M at the carriage return)

tr -d \'\015\' < win-format.txt > unix-format.txt (DOS to Linux)
sed -e \'s/$/\r/\' unix-format.txt > win-format.txt (Linux to DOS)

List the size of a directory

du -sh /

Burn ISO image to a CD

cdrecord -v dev=ATA:1,0,0 -eject -multi -data

SSH copy a file from a local machine to remote machine

scp @:

Example: text.txt bob@fsrv:/home/bob SSh copy a file from a remote machine to a local machine

scp -p :

SSH copy a directory recusively from a local machine to a remote machine

scp -r :

Erase the bootloader and the partition table

dd if=/dev/zero of=/dev/hda bs=512 count=1

Erase the bootloader but leave the existing partition table.

dd if=/dev/zero of=/dev/hda bs=446 count=1

Remove files from a list of files

cat filename | xargs rm

Backup files using tar from a list of files

tar -cv -T -f

sync system time

/usr/sbin/ntpdate clock.via.net; hwclock --systohc