Syntax Sugar

One liners and useful commands I found on the Internet.


Find PDF files recursively by file type and copy them to a directory (link).

find . -name "*.pdf" -type f -exec cp {} ./pdfsfolder \;

Copy/sync current directory locally

rsync -av . /path/to/dest/

Tmux cheatsheet: by andreyvit

Command line utilities

This guy has a cool script, which outputs the git branch names AND description. Add it to .bash_profile.


From here

git remote -v
git remote add origin <url>
git remote set-url origin <url>

Merge four previous, local commits into a single.

git rebase -i HEAD~4

Amend name of previous commit

git commit --amend

Useful links: original medium post, Google Angular.js commit guidelines

Working with text files

Read lines of a file into a list, removing newlines.

lines = [line.rstrip('\n') for line in open('filename')]