I love the command shell and I love the power at your fingertips whenever you log in via PUTTY (or any other client you can think of). When I first started with the command line I was astounded by how easy a simple command could provide so much power and control over your files, folders & server. Well Here are some simple ssh commands to get you through if you are unsure of anything:

Manual

The first thing to start off with is the manual for each command

man mv
(this opens up the manual with all available arguments)

This command is very helpful if you are unsure what a command does or if it even exists and all the potential arguments that come along with each command.




Moving

These commands allow you to move from one location to the other

mv source destination
example: mv /var/www/website.co.uk/httpdocs/index.php /var/www/website.co.uk/ 
(this would move from httpdocs folder up to the website.co.uk folder)


Copying

These commands allow you to copy from one location to the other. scp is a more secure connection copy, handy for copying from one server to another.

cp source destination
scp source destination
example: cp /var/www/old-website.co.uk/httpdocs/index.php /var/www/new-website.co.uk/httpdocs/ 
(this would move from old-website.co.uk folder up to the new-website.co.uk folder)


Create a folder

This is a command to allow you to create directories/folders

mkdir newfoldername
example: mkdir /var/www/website.co.uk/httpdocs/images/
(this would create a folder called images)


Create a file

This is a command to allow you to create directories/folders

touch newfilename
example: touch home.php
(this would create a php file called home.php)
example: touch scripts.js
(this would create a javascript file called scripts.js)


Search Your History

This will show you all commands entered previously

history


List

This will list all files/folders in the directory you are in unless you specify a location

ls
example: ls 
(this would list items in directory you are currently in)
example: ls /var/www/website.co.uk/httpdocs/
(this would list files in httpdocs)

In example above you would see all the files but not in a particular handy format to view, to output into a nicer output and easier to read, add on a few extra arguments as mentioned previously

ls -lah (long listing format and in human readable format)
example: ls -lah
(this would list items in directory you are currently in)
example: ls -lah /var/www/website.co.uk/httpdocs/
(this would list files in httpdocs)



Those are the most common commands I use on a day to day basis and in time I will add more common commands to this page as I remember them or people suggest them.

I hope these have been helpful, enjoy :)

Monthly Archives: April 2013

SSH – Some basic Commands

I love the command shell and I love the power at your fingertips whenever you log in via PUTTY (or any other client you can think of). When I first started with the command line I was astounded by how easy a simple command could provide so much power and control over your files, folders

Read more

PHP by reference

PHP by reference. Well this is something I thought I would add for those that may get confused by this aspect of PHP, I know for a fact when I started in PHP I was confused to begin with and would’ve much preferred someone to openly, simply and frankly explain it! So here we go…

Read more

Simple Vertical jQuery Slider

A Simple Vertical jQuery Slider. I was tasked recently with working on a site that had a very old vertical slider on the site. Looking into the code it was a mish mash of code within the header, in the actual template and in multiple external files. I spent a while following all these little

Read more

The Potential future of Design

The potential future of design is an interesting title I know I have now been working in the beautiful world of development for almost 4 years and I would say I have had the pleasure of working some utterly fantastic designers and let me clarify that this is not a post to be saying any

Read more

double border line CSS or CSS3

Hello Hello Hello! well this week I have been wondering what would be the coolest and what would be the most amazing, latest, greatest thing I could create to wow the world with utter pure explosive web development joy. I realised after a while I was over thinking and worrying about trying to impress any

Read more

Placeholder Polyfill

Here is a nifty bit of code I recently put together to loop through all your HTML5 placeholders and output the value equivalent in non-HTML5 browsers: $(function(){ +++$.fn.placeholdHTML(); +++$.fn.clearType(); }); $.fn.placeholdHTML = function (){ +++$(‘input, textarea’).each(function(){ ++++++var placehole = $(this).attr(‘placeholder’); ++++++$(this).attr(‘value’,placehole); +++}); }; $.fn.clearType = function () { +++$(‘input, textarea’).each(function(){ +++++++var thisVal = $(this).val(); +++++++$(this).focus(function()

Read more