Misc. Tool Tips

Table of Contents


  • Merge PDF files (*nix)
    gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite \
       -sOutputFile=merged.pdf f1.pdf f2.pdf ...
  • Add wide floats (figures, tables, etc.) into latex with \makebox
      \subfloat[sub title1]{
      \subfloat[sub title2]{


  • Find files with restrictions
    find . -path './.*' -prune -o -perm 700 -type f ! -name \*.py ! -name \*.pyc -print
    • -prune is used to exclude some of the path, such as .hg, .svn, etc.
    • ! is logical NOT on the following statement.
    • The last -print is essential, unless find will print the name of excluded directory (.hg for example). Referred to "Common Gotcha" section of this for more detailed explanation.
  • Copy files according to "find" results. There are several ways to do this:
    • Use -exec option of find, but may have performance issue if the number of resulting files is large.
      find . -name "test" -exec cp "{}" /dest/directory \;
    • Bridge find and cp with xargs, no potential performance issue.
      find . -name "test" -print0 | xargs -0 -I{} cp "{}" /dest/directory
    • A little variant to the last approach, only works with GNU cp
      find . -name "test" -print0 | xargs -0 cp -t /dest/directory

Last Updated: 2013-02-20, by Liang Wang

Created by Org version 7.9.3e with Emacs version 24