Bash: Basics and miscellany

Running notes and reminders on basic bash (and some other useful commands, in no particular order, that wouldn’t really make sense in another post).

cd: change directory
ls: list contents of directory
pwd: print working directory
hostname: what’s this computer’s name?
mkdir: make directory
rmdir: remove directory
touch: make empty file
cp: copy file (-r for dir)
mv: move or rename file
less: view file (q to escape)
cat: view file without stopping or paging
ctrl-c: stop program
sudo !!: run last command as root

pbcopy <: copy file contents to clipboard
open -a [] [filename]: open file with a given application on OSX
chsh -s /bin/bash: change shell (in this case, to bash)
sips -Z 600 *.jpg: batch resize, retaining aspect ratio, longest side will be 600px
dig +short txt [searchterm] ask Wikipedia for a text record and short URL via DNS