Last active
August 29, 2015 14:09
-
-
Save aceakash/471d021b663d3a7089ec to your computer and use it in GitHub Desktop.
Common shell commands I can't seem to remember
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------- tar-zip a folder | |
tar -zcvf path/archive-name.tar.gz directory-path/ | |
# e.g. | |
tar -zcvf ~/nginx-all.tar.gz /etc/nginx/ | |
# ----------------- copy contents of a folder | |
cp -a /source/. /dest/ | |
# ----------------- download a file off a remote server | |
scp USERNAME@REMOTE_HOST:FILE_NAME_IN_HOME_DIR LOCAL_DIR | |
# or with ssh port | |
scp -P SSH_PORT USERNAME@REMOTE_HOST:FILE_NAME_IN_HOME_DIR LOCAL_DIR | |
# e.g. | |
scp -P 654 rocky@balboa.com:my_backup.tar.gz ~/backups/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment