sarken
Remove all newlines
cat file.txt | tr -d '\n' > newfile.txt
Chop the last character of a file
head -c -1 file.txt
From line m to end of file
tail +m file.txt
sed -n 'm,$p' file.txt > file.new.txt
Exec'ing a command with find
find . -name "pattern" -exec cmd {} \;
Size of a file without using ls
stat -s "%s %N" file.txt
Rename file extensions using sh and sed
ls *.mp3 | sed 's/\(.\)\.mp3/mv "\1.mp3" "\1.m4a"/' | sh
Back to back tar via ssh
tar cf - files | ssh sarken.org "(cd /home/gord/tmp; tar xf -)"
Comparing two binary files byte by byte
cmp -lb file1 file2
Adding up a text file containing numbers
cat file.txt | awk '{total+=$0}END{print total}'