If you do any type of web-mastering at all, which I don't know why the fuck you are here if you don't, you need to know what I'm about to tell you.
I'll explain what SSH is, why you need it, and several commands to get you started on the process of accidentally fucking up your website with an SSH command.
Using SSH & Terminal to Get Shit Done 99% Faster.
If you don't know what SSH is, or how to use it to your benefit, take notes bitches.
1. SSH = Secure Shell. But who gives a shit?
Shit That Does Matter
1. SSH lets you delete a whole wordpress install from your server instantly.
2. SSH lets you delete a whole Magento install from your server instantly.
3. SSH lets you back up your whole site in a matter of seconds. As opposed to being a fucking nob-jockey and watching FileZilla trickle download your site files to your computer.
4. SSH lets you back up your database in a matter of seconds.
5. SSH lets you copy the contents of one database into another in seconds.
6. SSH lets you restore the database that you just fucked up from the backup that you thankfully made seconds before in a matter of seconds.
7. SSH lets you extract the backup of your site files on your server in a matter of seconds.
So, if you don't know anything about SSH, all of the above points should make your boys tingle. You'll notice that they all have one thing in common: fucking speed.
I don't know why I didn't take the time to learn about how to use SSH to jump onto my server before just a week or two ago when the shit was hitting the fan on a Magento site I was helping a client with & I had to wipe the whole thing and reinstall when I should have been eating Thanksgiving Dinner w/ my family. (some fucker hacked it)
But I learned a lot & now I impart my knowledge unto you.
How To Use SSH
If you're like me, you use an FTP client administer your website in every aspect. You may have heard about "root" access to your site, and "SSH" but you were either too lazy to play with it, or didn't know what the fuck it was. Now is the time to figure it out.
Shit You'll Need:
1. Terminal (on Mac), or some shitty SSH client on a Windows computer.
2. Login credentials for your website. You can use your standard FTP login, but I prefer root access. So you'll need to ask your host if you have root access. And if you don't have it, you're probably paying for shitty hosting. BTW I think you need root access to do anything with database dumps/imports.
3. Basic understanding of SSH commands.
I'll explain from the Mac point of view.
Logging In:
1. Open up Terminal on your Mac.
2. Type in ssh root@yourwebsite.com.
3. Enter password.
4. If you got in, you'll see something like root@host.
5. Congrats.
Basic Commands:
1. PWD (Print Working Directory)
When you type PWD, it tells you where the fuck you are on your server. If you're anything like me, you'll use this just about every other command.
2. CD (Change Directory)
This is the way you navigate around your site. Compare it to clicking in to a folder, but instead of clicking, you're typing the command. For instance, you might say cd /home/username/public_html/boobs/. That would get you in the "boobs" directory under your website. Bonus: At this point, if you typed in pwd, it would show return /home/username/public_html/boobs/. Simple enough.
3. MKDIR (Make Directory)
This lets you make a folder. So you might say something like mkdir boobs. And it would create a folder on your server called boobs.
4. CD .. (Change Directory, but go backwards)
Typing cd .. (notice the two dots) is just a simple way of telling the server to put you into the folder directly above the one you are in. So for example, if you were in /home/username/public_html/boobs/ and you typed in cd .. you would now be in the /home/username/public_html/ folder. Type pwd to double-check.
5. Fuck, I don't know what else, it's late and I haven't even found any booby pictures to add to this post yet.
Advanced Commands:
These commands fucking rock. They will save you ages. Literally.
1. Backup Your Database
mysqldump DATABASE_NAME > DATABASE_NAME.sql
Say you have navigated to the folder "/home/username/" on your server, and you're wanting to make a backup of your database. (not such a bad idea, btw if you're going to start fucking around with SSH commands). All you have to do is type in the above command, of course replacing the "DATABASE_NAME" and "DATABASE_NAME.sql" with a. the database name that you are backing up, & b. the name that you want to call the backup.sql.
2. Restore Live Database From Backup
mysql DATABASE_NAME < DATABASE_NAME.sql
This will let you restore your live database with the backup that you just made. So say you completely messed up your database, but you made a backup of it before. You'd just run that command. I'm tired & it's late & I haven't done this for a day or so, so I believe that you will need to have navigated to the folder that your backup database ".sql" file is in, before running this command, or your server won't know where the hell to find it.
3. Clone Database Contents To Another Database
mysqldump OLD_DATABASE_NAME | mysql NEW_DATABASE_NAME
This lets you copy the contents of one database into another. I believe this is a complete clone. Not a merge.
4. Quickly Back Shit Up
tar -cvf sitebackup.tar public_html/*
This lets you make a .tar backup of whatever you tell it to. In the above command, it would create a compressed file of the whole contents of the "public_html" folder. The * indicates that it is copying everything below the "public_html" folder. After it runs the command, you will have a file called "sitebackup.tar" in the folder that you were in when you executed the command.
5. Move Files/Folders From Folder Into Current Directory
mv foldername/* ./
This command lets you move all files and folders under the "foldername" directory and places them in the directory that you are currently in. This will come in handy, for instance if you have a folder called "wordpress" with all of your wordpress files, but you really want them in the root. So you would go "mv wordpress/* ./" After that, you'll have a folder called "wordpress" with nothing in it, and all of the files that were in it will be moved into the ./ folder, which is the one that you were in when you executed the command.
6. Extract Contents of .tar
tar -xvf filename.tar
This will extract the contents of filename.tar. So for instance, if you had a wordpress.tar file on your server, and you wanted to extract it, you'd go "tar -xvf wordpress.tar". Handy shit.
7. Unzip
unzip filename.zip
Pretty self explanatory. Just like untarring a file, but it's the unzip version.
8. Delete Everything in Current Folder
rm -rf *
This will delete EVERYTHING in the folder that you are in. Bound to fuck someone's site up, just by putting the command on here.
So this should get you started with SSH. Hopefully I've given you some reasons to get off your ass and figure it out as well as a quick overview of how to play around.
A word of advice: use the backup commands as your first experiments.
If there are mistakes in the above, feel free to point them out. This is just some shit I've learned recently that I wish I'd have had a firm grasp of a long time ago.
Learning this was almost like learning HTML again. The most basic shit, but handy to know.
Now, off to find some boobies.
K. Back ...
Done. That Cake Is Done.
I'll explain what SSH is, why you need it, and several commands to get you started on the process of accidentally fucking up your website with an SSH command.
Using SSH & Terminal to Get Shit Done 99% Faster.
If you don't know what SSH is, or how to use it to your benefit, take notes bitches.
1. SSH = Secure Shell. But who gives a shit?
Shit That Does Matter
1. SSH lets you delete a whole wordpress install from your server instantly.
2. SSH lets you delete a whole Magento install from your server instantly.
3. SSH lets you back up your whole site in a matter of seconds. As opposed to being a fucking nob-jockey and watching FileZilla trickle download your site files to your computer.
4. SSH lets you back up your database in a matter of seconds.
5. SSH lets you copy the contents of one database into another in seconds.
6. SSH lets you restore the database that you just fucked up from the backup that you thankfully made seconds before in a matter of seconds.
7. SSH lets you extract the backup of your site files on your server in a matter of seconds.
So, if you don't know anything about SSH, all of the above points should make your boys tingle. You'll notice that they all have one thing in common: fucking speed.
I don't know why I didn't take the time to learn about how to use SSH to jump onto my server before just a week or two ago when the shit was hitting the fan on a Magento site I was helping a client with & I had to wipe the whole thing and reinstall when I should have been eating Thanksgiving Dinner w/ my family. (some fucker hacked it)
But I learned a lot & now I impart my knowledge unto you.
How To Use SSH
If you're like me, you use an FTP client administer your website in every aspect. You may have heard about "root" access to your site, and "SSH" but you were either too lazy to play with it, or didn't know what the fuck it was. Now is the time to figure it out.
Shit You'll Need:
1. Terminal (on Mac), or some shitty SSH client on a Windows computer.
2. Login credentials for your website. You can use your standard FTP login, but I prefer root access. So you'll need to ask your host if you have root access. And if you don't have it, you're probably paying for shitty hosting. BTW I think you need root access to do anything with database dumps/imports.
3. Basic understanding of SSH commands.
I'll explain from the Mac point of view.
Logging In:
1. Open up Terminal on your Mac.
2. Type in ssh root@yourwebsite.com.
3. Enter password.
4. If you got in, you'll see something like root@host.
5. Congrats.
Basic Commands:
1. PWD (Print Working Directory)
When you type PWD, it tells you where the fuck you are on your server. If you're anything like me, you'll use this just about every other command.
2. CD (Change Directory)
This is the way you navigate around your site. Compare it to clicking in to a folder, but instead of clicking, you're typing the command. For instance, you might say cd /home/username/public_html/boobs/. That would get you in the "boobs" directory under your website. Bonus: At this point, if you typed in pwd, it would show return /home/username/public_html/boobs/. Simple enough.
3. MKDIR (Make Directory)
This lets you make a folder. So you might say something like mkdir boobs. And it would create a folder on your server called boobs.
4. CD .. (Change Directory, but go backwards)
Typing cd .. (notice the two dots) is just a simple way of telling the server to put you into the folder directly above the one you are in. So for example, if you were in /home/username/public_html/boobs/ and you typed in cd .. you would now be in the /home/username/public_html/ folder. Type pwd to double-check.
5. Fuck, I don't know what else, it's late and I haven't even found any booby pictures to add to this post yet.
Advanced Commands:
These commands fucking rock. They will save you ages. Literally.
1. Backup Your Database
mysqldump DATABASE_NAME > DATABASE_NAME.sql
Say you have navigated to the folder "/home/username/" on your server, and you're wanting to make a backup of your database. (not such a bad idea, btw if you're going to start fucking around with SSH commands). All you have to do is type in the above command, of course replacing the "DATABASE_NAME" and "DATABASE_NAME.sql" with a. the database name that you are backing up, & b. the name that you want to call the backup.sql.
2. Restore Live Database From Backup
mysql DATABASE_NAME < DATABASE_NAME.sql
This will let you restore your live database with the backup that you just made. So say you completely messed up your database, but you made a backup of it before. You'd just run that command. I'm tired & it's late & I haven't done this for a day or so, so I believe that you will need to have navigated to the folder that your backup database ".sql" file is in, before running this command, or your server won't know where the hell to find it.
3. Clone Database Contents To Another Database
mysqldump OLD_DATABASE_NAME | mysql NEW_DATABASE_NAME
This lets you copy the contents of one database into another. I believe this is a complete clone. Not a merge.
4. Quickly Back Shit Up
tar -cvf sitebackup.tar public_html/*
This lets you make a .tar backup of whatever you tell it to. In the above command, it would create a compressed file of the whole contents of the "public_html" folder. The * indicates that it is copying everything below the "public_html" folder. After it runs the command, you will have a file called "sitebackup.tar" in the folder that you were in when you executed the command.
5. Move Files/Folders From Folder Into Current Directory
mv foldername/* ./
This command lets you move all files and folders under the "foldername" directory and places them in the directory that you are currently in. This will come in handy, for instance if you have a folder called "wordpress" with all of your wordpress files, but you really want them in the root. So you would go "mv wordpress/* ./" After that, you'll have a folder called "wordpress" with nothing in it, and all of the files that were in it will be moved into the ./ folder, which is the one that you were in when you executed the command.
6. Extract Contents of .tar
tar -xvf filename.tar
This will extract the contents of filename.tar. So for instance, if you had a wordpress.tar file on your server, and you wanted to extract it, you'd go "tar -xvf wordpress.tar". Handy shit.
7. Unzip
unzip filename.zip
Pretty self explanatory. Just like untarring a file, but it's the unzip version.
8. Delete Everything in Current Folder
rm -rf *
This will delete EVERYTHING in the folder that you are in. Bound to fuck someone's site up, just by putting the command on here.
So this should get you started with SSH. Hopefully I've given you some reasons to get off your ass and figure it out as well as a quick overview of how to play around.
A word of advice: use the backup commands as your first experiments.
If there are mistakes in the above, feel free to point them out. This is just some shit I've learned recently that I wish I'd have had a firm grasp of a long time ago.
Learning this was almost like learning HTML again. The most basic shit, but handy to know.
Now, off to find some boobies.
K. Back ...











Done. That Cake Is Done.