After learning how to log into your server using SSH, you will need to know how to navigate through the file system. This article will go over the basics of moving around your hosting account.

For example purposes in this tutorial, we will assume a domain name of example.com and a cPanel username of exampl5

The command prompt

When you log in you will see a bit of text on the screen. This is called your prompt. You will see your username and domain name followed by a bracket that gives your location within your account. It looks something like this:

exampl5@example.com[~]#

What is my starting location?

When you first log in you begin in your home folder. This is noted by the ~ symbol in your prompt. You can check this by executing the pwd command.

exampl5@example.com [~]# pwd
/home/exampl5

What is in this directory?

Now that you know where you are, you may want to know what files and folders are within this directory. You can use the ls command to provide that list.

exampl5@example.com [~]# ls
./  ../  .htpasswds/  etc/  mail/  perl5/  public_ftp/  public_html/  tmp/ 

The results are a simple list of files and folders in your current account. You may need more information than this. For example, you may need to see file sizes or permissions. You can add the -alh flags to give more detailed information. Definitions of the a, l, and h flags are found below.

  • a - do not ignore entries starting with . (hidden files, such as .htaccess)
  • l - use a long listing format (shows additional information such as filesizes and permissions)
  • h - when using -l (described immediately above), prints file sizes in human readable format (e.g., 1K 234M 2G)

exampl5@example.com [~]# ls -alh
total 60K
drwx--x--x   9 exampl5 example5  4.0K Dec  5 11:23 ./
drwx--x--x  36 root    root      4.0K Dec  5 11:15 ../
drwxr-x---   2 exampl5 nobody    4.0K Dec  5 11:15 .htpasswds/
drwxr-x---   2 exampl5 mail      4.0K Dec  5 11:15 etc/
drwxr-x---   8 exampl5 exampl5   4.0K Dec  5 11:15 mail/
drwxr-xr-x   2 exampl5 exampl5   4.0K Dec  5 11:23 perl5/
drwxr-xr-x   3 exampl5 exampl5   4.0K Dec  5 11:15 public_ftp/
drwxr-x---   3 exampl5 nobody    4.0K Dec  5 11:15 public_html/
drwxr-xr-x   2 exampl5 exampl5   4.0K Dec  5 11:15 tmp/

How can I change directories?

You can change directories by using the cd command. For example, if we want to move down to the public_html folder, the command would look like this:

exampl5@example.com [~]# cd public_html/

You can then use the pwd you used earlier to display the current location to confirm:

exampl5@example.com [~/public_html]# pwd
/home/exampl5/public_html

How do I go back up a directory?

We started out at /home/exampl5 and we changed to the /home/exampl5/public_html folder. If we decided we wanted to go back up one folder (in this case, back to our home folder of /home/exampl5) we would use the cd .. command.

exampl5@example.com [~/public_html]# cd ..

Just as we did previously, you can confirm the current location by using the pwd command.

exampl5@example.com [~]# pwd
/home/exampl5

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}