Select Page

I just started learning SSH recently, since few years back I didn’t find it useful to my work but right now things have changed.

So here are the things that I have learned and tested it on my server hope this will help.

What are the requirements

You will need to have a SSH application like putty or openssh, i’m using linux fedora distro so I using the SSH application already installed in the operating system

Here are SSH commands

1. To connect to your server using SSH open the terminal (in linux) or the SSH application you installed in windows and add this command

ssh username@server_or_ip

It will ask for your password, enter your password

2. To know what is your path or location in the server

pwd

3. List all the directories or files inside the server

ls -alh

4. Remove or delete

rm filename.php to remove a directory recursively rm -r directory_name

5. Copy

cp [source] [location]

cp file1.php file2.php

This means copy the file1.php and paste it in the directory of where you are with the name file2.php

to copy a directory

cp -r folder /path/folder

6. Move or rename

mv file1.php file2.php

This means move the file1.php and paste it in the directory of where you are with the name file2.php

to copy a directory

mv -r folder /path/folder

mv * ~/path/folder

This will move all files to the new location

7. To transfer a file from your local computer to your server and vice versa

scp username@server_or_ip:/path/file.php     file.php

or

scp file.php username@server_or_ip:/path/

So far these are the SSH commands that I have learned, I will update this post when I have new commands. Or if you know more about SSH and have commands to share please do so by leaving a comment below.

More SSH commands https://mediatemple.net/community/products/dv/204643550/common-ssh-commands

Pin It on Pinterest

Share This