To update the contents of to_dir based on the contents of from_dir:

export RSYNC_RSH=ssh rsync -Cuvaz machine:from_dir/ machine:to_dir/

-C: don't worry about emacsbackup~ files, etc.
-u: update
-a: preserve owner, mod times, and other metadata
-v: be verbose
-z: compress information sent over the network.

To see the contents of an installed RPM:

  rpm -ql PACKAGE List files in an installed package.
  rpm -qi PACKAGE Give info about an installed package.
  rpm -qlp PACKAGE List files in a (possibly uninstalled) RPM file.
  rpm -qilp FILENAME.rpm Give info and list files for a (possibly uninstalled) RPM file.
 
  rpm -qf SOMEFILE What package made this file?
  rpm -qa | egrep ".*string" Does any installed package contain this string?
 
  rpm -Uvh PACKAGE Install/Upgrade the given package.
  rpm -evx PACKAGE Uninstall the given package.
Build from sources: rpm -iv --rebuild foo.src.rpm cd /usr/src/redhat/RPMS rpm -Uvh foo*.rpm

A shell wildcard that lists only hidden files:

ls .??*
This actually only lists files longer than three characters, but that's usually OK.
We need this stunt because ls .* will include '.' (current directory) and '..' (parent directory), which you usually don't want.

Do something to each file in a directory:

The 'xargs' command does the right thing with each file given on its standard input.
Remove all the files in otherdir that exist in thisdir.
ls -1d ./* | xargs -i rm otherdir/{}
Append the extension ".bak" to each file.
for foo in * ; do mv $foo $foo.bak ; done
Remove all the files in otherdir that exist in thisdir.
cd thisdir for foo in * ; do rm otherdir/$foo ; done
Rename all files with spaces to use underscores instead
for foo in * ; do mv "$foo" `echo $foo | sed 's/ /_/g'` ; done
To "Preview" a command before using it, put 'echo' right ahead of the dangerous command to run.
for foo in * ; do echo mv "$foo" `echo $foo | sed 's/ /_/g'` ; done

** ERROR **: Gdkxft requires gtk+ version 1.2 - this appears to be 2.0 aborting... ? unset LD_PRELOAD then try again.

To make a patch:
diff -u -n

If it's a patch spanning multiple directories, you might need:
export POSIXLY_CORRECT=1 patch -p0 < mypatch.diffs