How to Use the Command Line Interface
Note: By default, command line access is not enabled on hosting accounts. Please open a support ticket to request this service.
If you have always used the Windows, Ubuntu (Linux) or Mac OS operating systems, you could find the command line interpreter of Linux puzzling. There are no images or icons to click with your mouse (although you can use it to copy/paste text).
After connecting with PuTTY or another SSH client, the server will display a "shell" A shell is a program that allows you to interact with a server. On the majority of Linux servers, the Bash shell is used. The acronym Bash stands for "Bourne Again SHell", and is the most popular shell in Linux. The shell contains a command line interface (also called command prompt). On Web Hosting Canada servers, the command prompt looks like:
where "username" is your cPanel user name and "servername" is the name of the server. This is followed by a colon (:), which delimits the first and second parts of the command prompt. Its second par consists of a tilde (~) and a dollar sign ($).
The tilde specifies that you are in the Linux file system, in your home folder (usually /home/yourusername/).
The dollar sign is just the final character of the command prompt.
In some cases, your command prompt could look like: "-jailshell-3.2$".
Here are some useful commands:
ls – list the files and folders in the active folder. The files and folders appear in different colors. One of the subfolders of your home folder should be called public_html.
cd [folder] – change the active folder.
more [file] – display the contents of a text file.
vi [file] – change the contents of a text file with the VI advanced editor.
mv [file] [destination] – move or rename one or several files towards [destination].
cp [file] [destination] – copy one or several files to [destination].
rm [file] – delete a file.
This article is a basic introduction. To learn more about this command line interpreter, the following tutorial is recommended:
Article ID: #HC5073