Apply a command to multiple files:
find <path> -name <file-pattern> -type f -exec <command> '{}' \;
Concatenate multiple files:
cat `find -name <file-pattern>` > <output-file>
Strip end of line characters:
tr -d '\r' < <input-file> > <output-file>
Syntax highlight code in html:
vim -f +"syntax on | let html_use_css = 1 | source \$VIMRUNTIME/syntax/2html.vim | write | qall" <input-file>
Count columns:
awk '{ if (NR==1) {print NF} }' <input-file>
Suspend/resume a process:
kill -SIGSTOP <pid>
kill -SIGCONT <pid>
Compress/decompress a directory:
tar -zcf dir.tar.gz dir
tar -zxf dir.tar.gz
Convert to upper-case:
tr [:lower:] [:upper:] < <input-file> > <output-file>
Print a latex table to pdf:
\pagestyle{empty} in preamble of latex file containing table
latex table.tex
dvips -E -o table.ps table.div
pstopdf table.ps
pdftops -eps table.pdf
|