1. # text processing:
    1. # convert characters from lower to upper case:
       fortune | tr [:upper:] [:lower:] 
    2. # finding out how many times a particular item, in this case a dot, occurs on a text line
       for a in `cat /tmp/file.txt`; do
        nof=$[`echo $a|sed s/'\.'/'\n'/g|wc -l` -1]
        echo  a . occurs $nof times in $a
    3. # unescaping escaped text/html/javascript/... found in a file $LOGFILE:
       cat $LOGFILE|sed s/+/' '/g|sed s/%0D%0A/" -- "/g|sed s/%20/" "/g|sed s/%21/'!'/g|\
      sed s/%22/'"'/g|sed s/%23/'\#'/g|sed s/%24/"$"/g|sed s/%25/"%"/g|sed s/%26/"\&"/g|sed s/%27/"'"/g|\
      sed s/%28/'('/g|sed s/%29/')'/g|sed s/%2A/'*'/g|sed s/%2B/'+'/g|sed s/%2C/','/g|sed s/%2D/'-'/g|\
      sed s/%2E/'.'/g|sed s/%2F/'\/'/g|sed s/%3A/':'/g|sed s/%3B/';'/g|sed s/%3C/'<'/g|sed s/%3D/'='/g|\
      sed s/%3E/'>'/g|sed s/%3F/'?'/g|sed s/%40/'@'/g|sed s/%5B/'['/g|sed s/%5C/'\\'/g|sed s/%5D/']'/g|\
      sed s/%5E/'^'/g|sed s/%5F/'_'/g|sed s/%60/'`'/g|sed s/%7B/'{'/g|sed s/%7C/'|'/g|sed s/%7D/'}'/g|\
      sed s/%7E/'~'/g|sed s/%D3/'<'/g 
    4. # a very nice overview of commonly used text processing commands can be found at http://www.tldp.org/LDP/abs/html/textproc.html
    5. # remove all blank lines from a file:
       grep -v '^$' input.txt > output.txt 
    6. # count the number of newlines, words and bytes in a text file:
       wc input.txt 
    7. # reverse all the lines in a file:
       rev file.txt 
  2. # file processing:
    1. # dog is an enhancement of cat
    2. # count the number of times a particular character (in the example a comma) occurs in some file:
       cat file.txt | tr -c -d ',' | wc -c 
    3. # character set translator -- translates character sets from one encoding to another (utf-8, ascii, iso 8859-[123456789], unicode, msdos,...):
    4. # make a hexdump or do the reverse:
       xxd file > file.hex
       xxd -r file.hex > file.bis 
    5. # dump a file byte per byte using octet, decimal, hex or binary notation:
       od -j 2 -t x1 file > file.hex 
    6. # replace all spaces in all relevant file names by underscores:
       find . -name \*' '\* -exec rename s/' '/_/g "{}" \; 
    7. # strip the path from a filename, or the last part of an absolute path:
       basename extendedFilename; dirname extendedFilename 
    8. # find all files that are between 100 and 50 days old:
       find . -mtime +50 -mtime -100 -daystart 
  3. # process processing:
    1. # redirect stderr to stdout:
       buggyProg 2>&1 
    2. # redirect stdout to stderr:
       buggyProg 1>&2 
    3. # redirect both stderr and stdout to a file:
       buggyProg &> file