Chris Simpkins
Research Scientist, PhD Student

Home

Curriculum Vitae

Research

Publications

Presentations

Coursework

Useful Info

Command Line Tips

Note: this is all in bash.

  1. Use a Unix, such as Linux or Mac OS X. Your'e really missing out if your'e using Windows.

  2. Changing the file extensions of all .lsp files in a directory to .lisp
    for file in `ls *.lsp`; do mv $file `basename $file lsp`lisp; done;

  3. Replacing text in a file.
    perl -pi -e "s/old/new/g" filename.txt

  4. Replacing text in a bunch of files
    find . -name "*.ext" -exec perl -pi -e "s/old/new/g" {} \;