| command | description | group |
|---|---|---|
| tar -zcf ./ARCHIVE.tar.gz ./PACK_FILE.sql | Make gzipped tar file from PACK_FILE.sql | tar |
| tar -zxf ./ARCHIVE.tar.gz | Unpack ARCHIVE.ta.gz | tar |
| ls -R ./whales/ ı wc -l | Count number of all files and directories in directory | files |
| du –max-depth=1 -b ./whales/6/0/12 ı sort -n | Get size of all dirs in one directory and sort them by the size | files |
| cat access_log ı grep 'addCount' ı wc -l | Count the occurence of addCount in Apache's access log | files |
| find ./ -name '.svn' -exec rm -fR {} \; | Delete all .svn directories from current directory and subdirectories | files |
ı means pipeline (|)
| command | description |
|---|---|
| mysql -uUSER -pPASSWORD db_name < ~/import.sql | Import SQL dump |
ssh -L LOCALHOST_PORT:DATABASE_HOST_AT_REMOTE_SERVER:PORT_OF_DATABASE_AT_REMOTE_SERVER SSH_USER@REMOTE_SERVER
If you need to connect to mysql host mysql.yourhosting.com:3306 at yourhosting.com through your local port 8889:
ssh -L 8889:mysql.yourhosting.com:3306 root@yourhosting.com # usually you will use something like this: # ssh -L 8889:localhost:3306 root@yourhosting.com
Then connect with your MySQL manager on your localhost to localhost:8889 and use same login details as on the hosting server
ssh -l root -C -R 3690:192.168.1.100:3690 remote_server.com