Various utility command lines
Here I put all the terminal, bash, windows commands that can be useful. It helps me forgetting them
Add recursively files to svn (support spaces):
svn st --ignore-externals | grep ^? | sed 's/\? *\(.*\)/svn add "\1"/' | sh
Convert a movie file to flv with ffmpeg:
ffmpeg -i inFile.avi -f flv -y outFile.flv
Find file older than x days:
find * [-maxdepth 0] [-daystart] -mtime +x
Get the listening services on a box (t=tcp, u=udp, n=numeric, l=listening, p=pid):
sudo netstat -plutn
Get the reverse of blocked hosts (with denyhosts for example):
cat /etc/hosts.deny | awk '{print $2}' | xargs -L 1 host
Save the installed package on ubuntu:
dpkg --get-selections > selections.txt
And restore them:
sudo apt-get update && sudo dpkg --set-selections < selections.txt && sudo apt-get dselect-upgrade
Know which Ubuntu version you are running:
lsb_release -a
Upgrade Ubuntu from command line:
sudo do-release-upgrade
Transfer folders with tar and ssh:
tar czf - folder/ | ssh user@domain.com tar xzf - -C destfolder/