Last active
December 21, 2015 07:09
-
-
Save nexxos/6269009 to your computer and use it in GitHub Desktop.
Notes on and cheat sheet for SSH, Linus, Bash...
This file contains hidden or 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
# Find files named aida.pdf, aida.png, etc. anywhere | |
find ~/* -name "aida*" | |
# More on find | |
# http://www.codecoffee.com/tipsforlinux/articles/21.html | |
# Show size of subdirectories, total | |
# disk usage (estimated) | sorted by numerical value | |
du -smc * | sort -n | |
########################################################################## | |
## Backing-up/Cloning a MySQL5 database | |
# (tested with provider 1&1, shared hosting) | |
## DB Dump | |
# db -> sql | |
mysqldump --host=dbxxxxxxxxx.db.1and1.com --u=dboyyyyyyyyy | |
--password=11111111 dbzzzzzzzzz > db_production.sql --socket=/tmp/mysql5.sock | |
## DB Restore/Setup | |
# sql -> db | |
mysql --host=dbxxxxxxxxx.db.1and1.com --user=dboyyyyyyyyy | |
--password=22222222 -S /tmp/mysql5.sock dbzzzzzzzzz < db_production.sql | |
########################################################################## | |
## Backing-up entire directories | |
## compress directory | |
# --exclude='/htdocs/logs/*' | |
## to avoid including directories in use or too large | |
tar -cvzf yyyy-mm-dd-images.tar images/ | |
## open new terminal and copy remote archive to local destination | |
scp [email protected]:/customers/homepages/00/d111111111/htdocs/images/yyyy-mm-dd-images.tar /Applications/MAMP/htdocs/example.com/images | |
## uncompress | |
cd /Applications/MAMP/htdocs/example.com/images | |
tar xf yyyy-mm-dd-images.tar | |
## check result | |
ls images |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment