Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

samsargent commented Nov 17, 2015

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

@samsargent

This comment has been minimized.

Copy link
Owner Author

samsargent commented Nov 17, 2015

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

@samsargent

This comment has been minimized.

Copy link
Owner Author

samsargent commented Dec 10, 2015

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

@samsargent

This comment has been minimized.

Copy link
Owner Author

samsargent commented Dec 13, 2015

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
You can’t perform that action at this time.