HANDY SHELL COMMANDS: (more to be added) Make filenames lower case: for i in * ; do mv $i `echo $i |tr '[A-Z]' '[a-z]'` ; done Generate afm files for pfb fonts: for i in *.pfb ; do pfb2pfa $i >`basename $i .pfb`.pfa ; pfa2afm `basename $i .pfb`.pfa >`basename $i .pfb`.afm ; done Convert pfm files to afm files: for i in *.pfm ; do pfm2afm $i ; done Rasterise Postscript at 100 DPI: zcat foo.ps.gz | gs -q -dNOPAUSE -sDEVICE=pbm -r100x100 -sOutputFile=- - |ppmtogif Correct file name numbering: find . -maxdepth 1 -name '000-???.tif' -exec sh -c 'mv "{}" `echo "{}" |sed -e "s/\(000-\)\(...\.tif\)/\2/"`' \; Correct line ends in files from MS-DOS on all files in current dir, placing results in ./b (which must exist): find -maxdepth 1 -name '*.txt' -exec sh -c "sed -e 's/'`echo -ne '\r'`'/'`echo -ne '\n'`'/g' < \"{}\" > b/\"`basename {}`\"" \; Rotate TIFF images by 90 degrees, placing results in b/ (which must exist): find -maxdepth 1 -name '*.tif' -exec sh -c "tifftopnm \"{}\" |pnmflip -rotate90 |pnmtotiff > b/\"`basename {}`\"" \; Scale JPEG's by 50%, put result in b/: find -maxdepth 1 -name '*.jpeg' -exec sh -c "echo \"{}\" ; cat \"{}\" |djpeg -scale 1/2 |cjpeg -quality 90 >b/\"`basename {}`\"" \; Try to extract a list of C function definitions from a file (to find prototypes, remove the ^ near the end of the expression): grep -e '^[[:alnum:]][^()=]* [^()= ][^=]*(.*)[^;]' The following are more for my reference and not of so much use to anyone else... Take a targa file, add copyright notice and convert to jpeg; change c.pbm to c2.pbm for white, edit yoff to 30 pixels above bottom of image: tgatoppm foo.tga |pnmcomp -alpha ~/c2.pbm -yoff 730 ~/c.pbm |cjpeg >foo.jpeg Print a gif bitmap on 300 DPI HP laserjet: giftopnm foo.gif pbmtolj -resolution 300 |lpr Print a gif bitmap on 300 DPI HP laserjet in landscape mode: giftopnm foo.gif |pnmflip -ccw |pbmtolj -resolution 300 |lpr Reduce A4 bitmap to fit on letter paper and pad to centre: pnmscale 0.931 |pgmtopbm -threshold |pnmpad -white -l84 Convert PDF files to TIFF, placing result in output dir: find . -name '*.pdf' -exec sh -c 'echo Processing "{}" ; mkdir "`dirname "{}"`/output" 2>/dev/null ; gs -dNOPAUSE -sDEVICE=tiffpack -r600x600 -sOutputFile="`dirname "{}"`/output/`basename "{}" ".pdf"`-%d.tif" "{}" -c quit' \; |tee output.txt Generate postscript file in signature (2x A5 pages to A4): cat _a.ps |psbook |psnup -pa4 -s1 -2 >pa.ps Print odd pages: psselect -o pa.ps >pa_o.ps Print even pages: psselect -e pa.ps >pa_e.ps Print A5 booklet on A4 duplex on HP5Si: cat book.ps |psbook |psnup -pa4 -s1 -2 |\ lpr -Plp2o -J 'PageSize:A4 Duplex:DuplexTumble' Print A4 booklet on A3 duplex on HP5Si: cat book.ps |psbook |psnup -pa3 -s1 -2 |\ lpr -Plp2o -J 'PageSize:A3 Duplex:DuplexTumble'