Unix

http://robin.me/pi
======================== Redirecting bash script output to syslog exec 1> >(logger -s -t $(basename $0)) 2>&1 ======================== command line replacement: $ !!:s/102/1002 ======================== head -n 2 < list1 > list2 will read from list1, passing it to head to take the first two lines, then putting these in a file called list2. Add in a pipe: sort < list1 | uniq > list3 export PS1="[\$(date +%k:%M:%S)]\u@\h \w> " clear ~. kills current ssh session tar zxvf Rpi.GPIO-0.4.1a.tar.gz sudo dd if=~/Downloads/2015-05-05-wheezy-raspbian.img of=/dev/sdb bs=1M Use sudo fdisk -l both before and after plugging in the SD card (you can also use df to see what’s mounted). If, say, a /dev/sdb appears, with the size equal to the SD card, then unmount with umount /dev/sdb1. Now copy the disk image with perl script to replace tabs with spaces perl -pi.old -e 's{\t+}{ }g' file.txt ======================== # m h dom mon dow command # * * * * * command to execute # ┬ ┬ ┬ ┬ ┬ # │ │ │ │ │ # │ │ │ │ │ # │ │ │ │ └───── day of week (0 - 7) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0) # │ │ │ └────────── month (1 - 12) # │ │ └─────────────── day of month (1 - 31) # │ └──────────────────── hour (0 - 23) # └───────────────────────── min (0 - 59) For example: 0 0 * * * /home/pi/backup.sh @reboot python /home/pi/myscript.py &