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.
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:
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
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.
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/
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
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
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: | 757-416-6627 | Chat: | Click To Chat Now |
We value your feedback!
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.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!