AchuM
10/21/2013 - 1:34 PM

bash.md

####Search

find ~/ -type f -name "postgis-2.0.0"

####Rsync with progress:

rsync -r -v --progress -e ssh user@remote-system:/address/to/remote/file /home/user/

####Move files with a specific string to another folder

find -maxdepth 1 | grep '.pem' | xargs -I {} mv {} backups/

####Remove all files with certain string

find -maxdepth 1 | grep '.tar.gz' | xargs rm -f

####Linux - kill processes which have a certain string

sudo kill `ps -ef | grep my_search_term | grep -v grep | awk '{print $2}'

####Find directory sizes

du -sh *

Find delete files

find . -iname '*.mpg' -exec rm -rfv {} +

List and sort directory by size

du -m --max-depth 1 | sort -rn