Secure-Shell (SSH) Reference Sheet – Database

This is the continuation of my Secure-Shell Reference Sheet – Basic.

Note: Anything surrounded by *asterisks* is where your input is required.

Accessing a Database
mysql -u *username* -p *password* -h *hostname* *database*

This will log in directly

mysql -u *username* -h *hostname* *database*

This will prompt you for the database user’s password
Continue reading Secure-Shell (SSH) Reference Sheet – Database

SSH Reference Sheet – Basic

SSH Reference Sheet – basic Secure-shell commands for every day use!

The more I work with SSH, the more I love it! Unfortunately, half the time I forget the commands. This is the first of a series of “Reference Sheets” to help myself and others learn/remember SSH commands.

Note: Anything surrounded by *asterisks* is where your input is required.

Change Directory
cd *directory*
List the contents of a directory
ls *directory*

Continue reading SSH Reference Sheet – Basic

Creating a SQL database (and user) through SSH

This is how you create a database and corresponding user through secure shell. I am taking from the point of being connected to your server through SSH. First you log into your sql database on your server.

Note: [username], [password], [hostname] and [database-name] are all place-holders. This is where you insert your credentials without the square brackets [ ].

mysql -u[username] -p[password] -h[hostname]

Continue reading Creating a SQL database (and user) through SSH

Extracting a Single File/Folder from a .tar Ball

It’s actually quite simple! The standard un-tarring SSH line is:

tar -xzvf your-tar-ball.tgz

You can target a specific file or folder by adding another parameter:

tar -zvxf your-tar-ball.tgz your-folder
tar -zvxf your-tar-ball.tgz your-folder/subfolder/image.jpg

Note: The process will go through the entire tarball, so be patient!