Patricio Cubillos

Astronomer


Shell cheat sheet:

To create a link in current directory to Classic:
cd Volumes/Classic
cd
ln -s Volumes/Classic/ Classic

Find words into files:
find -name '*.py' -exec grep 'words' {} \; -print

Convert png files to mpg:
ffmpeg -f image2 -qscale 5 -b 9600 -i temp_%05d.png -r 20 movie_rad1_rot1.mpg
or
mencoder mf://*.png -fps 20 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1400 -ffourcc DIVX -o movie6.avi

Concatenate pdf files:
gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf ...

File synchronization:
Syntax: rsync source destination
Example: From remote (exo) to local machine:
rsync -av patricio@exo.physics.ucf.edu:/home/esp01/ /Users/pato/Documents/esp01/

List entries in a bibtex file:
find -name 'bibfile.bib' -exec grep '@' {} \; -print

Count entries in a bibtex file:
find -name 'bibfile.bib' -exec grep '@' {} \; -print | wc -l

Print ascii file to pdf:
enscript -o - ascii.txt | pstopdf -i -o file.pdf

Set permissions:
find . -type f | xargs chmod 664
find . -type d | xargs chmod 2775

Change group:
chgrp -R esp01 .

Color prompt in SSH connections (for OSX):
Add in .bash_profile:
export CLICOLOR=1
export TERM=xterm-color



This site is © Copyright Patricio Cubillos 2014, No Rights Reserved.
Free web templates