Skip to content

Instantly share code, notes, and snippets.

@yeephycho
Last active March 21, 2018 07:56
Show Gist options
  • Save yeephycho/8f8f5c294a327de02e287dda39ee76e6 to your computer and use it in GitHub Desktop.
Save yeephycho/8f8f5c294a327de02e287dda39ee76e6 to your computer and use it in GitHub Desktop.
compress folder command
#!/usr/bin/env bash
# tar command
# tar compress folder
tar -zcvf archive-name.tar.gz directory-name
# tar extract file
tar -zxvf archive-name.tar.gz -C /tmp
# ssh move file between server
# move file from local to remote
scp local_file remote_username@remote_ip:remote_folder
# move folder from local to remote
scp -r local_folder remote_username@remote_ip:remote_folder
# move file from remote to local
scp [email protected]:/opt/soft/demo.tar /opt/soft/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment