Skip to content

Instantly share code, notes, and snippets.

@samsargent
Created October 27, 2015 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samsargent/ff2ee1997d2ac34e9ef9 to your computer and use it in GitHub Desktop.
Save samsargent/ff2ee1997d2ac34e9ef9 to your computer and use it in GitHub Desktop.
SSH Snippets
# for the things I rarely do but often forget
# copy files via ssh
scp foobar.txt your_username@remotehost.com:/some/remote/directory
@samsargent
Copy link
Author

untar but ignore existing files (don't overwrite)
tar --skip-old-files -xzvf media.tar.gz

@samsargent
Copy link
Author

Update public_html symlink to application web folder
ln -s /home/username/application/current/web/ public_html

@samsargent
Copy link
Author

Find replace text across multiple files
perl -pi -w -e 's/SEARCH_FOR/REPLACE_WITH/g;' *.txt

@samsargent
Copy link
Author

Tar directory, exclude files
tar -czvf name.tar.gz --exclude .git --exclude "*.log" .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment