Navigation

Copying large amout of files/dirs over SSH using RSYNC

To copy files from remote server to local:

rsync -vrplogDtH -e ssh user@remotehost:/remote/location /this/dir/

To copy files from local to remote server:

rsync -vrplogDtH /this/dir/ -e ssh user@remotehost:/remote/location

-v, --verbose increase verbosity
-r, --recursive recurse into directories
-p, --perms preserve permissions
-l, --links copy symlinks as symlinks
-o, --owner preserve owner (super-user only)

Find And Replace Text in Multiple File in Linux Console

find . -name '*.txt' | xargs perl -pi -e 's/oldtext/newtext/g'

examples:

find . -name '*.txt' | xargs perl -pi -e 's/From: root/From: csf\@donie\-centos5\.slowrock\.com/g'
find . -name '*.txt' | xargs perl -pi -e 's/To: root/To: donie\@slowrock\.com/g'