Uses Of SSH Client Commands In Your Linux Server

February 29, 2012 / Linux

Uses Of SSH Client Commands In Your Linux Server:

SSH allows you to connect to a remote computer – for example, your Web server. This protocol allows commands to be carried out on that computer, such as moving and copying files, creating directories (folders), and running scripts. An SSH client should be installed on your computer to be able to talk to the remote server.

A. The ls command

LS stands for “list”. Ls helps the user to lists all the files and directories in their current directory. User has to type ls and press Enter to find out a listing appears in the terminal window:

username@webserver:~$ ls
myfile.txt   myfile2.txt   mysite.com

B. The cd command

Cd stands for “change directory”. Users can able to to move into and out of directories, much like double-clicking folders on his/her PC with the cd command. Such as, if ownsite.com listed above is the directory containing the user’s website, he/she can move into the directory as follows:

username@webserver:~$ cd ownsite.com

The user can then do another ls to list the contents of the ownsite.com directory:

username@webserver:~/mysite.com$ ls
cgi-bin   htdocs   logs

To move back up a directory, use cd .. (“..” means “the parent directory”). After using this, the user can be back in the original directory:

username@webserver:~/mysite.com$ cd ..
username@webserver:~$ ls
myfile.txt   myfile2.txt   mysite.com

C. The pwd command

It’s important to know your exact current directory. To find this out, type the command pwd (short for “print working directory”) and press Enter. The computer displays the full path to the current directory.

username@webserver:~$ pwd
/home/users/username/

D. The more command

To quickly browse through the contents of a text file on your server. Just type more followed by the name of your file, and press Enter:

username@webserver:~$ more myfile.txt
Project Gutenberg's The Complete Works of Artemus Ward, Part 1
#1 of this seven part series by Charles Farrar Browne

Copyright laws are changing all over the world, be sure to check
the laws for your country before redistributing these files!!!

Please take a look at the important information in this header.
We encourage you to keep this file on your own disk, keeping an
electronic path open for the next readers.

Please do not remove this.

This should be the first thing seen when anyone opens the book.
Do not change or edit it without written permission.  The words
are carefully chosen to provide users with the information they
--More--(16%)

Leave a Reply

Your email address will not be published. Required fields are marked *