View Thread
Web Master Trouble » Linux Apache MySQL PHP optimalisation tips tricks » Linux tutorials, Tips & Tricks
 Print Thread
Finding your way on your first ever VPS ? Part I

In the past, I have shown you how to connect to your VPS over SSH on both Windows and Linux. But if you are a first-timer and you have never used a VPS before, you may be quite lost once you're on your server. In this tutorial, I want to show you some basic commands for moving around your first ever (Linux-based) VPS.

I am going to assume a Debian-based distribution in my examples. I'm using Ubuntu 14.04 more specifically. Most commands should work on any Linux distribution; the only distribution-specific commands are those for the package manager.

Ready? Set? Let's go!


The first command I want you to know about is 'ls'. 'ls' is used to list directory contents, so it lists the files and directories contained in the the directory you currently are in. When you log in via SSH, you end up in your username's home directory. In case of root, this is /root. In case of a regular user, it is usually /home/{username}. To use 'ls' just type:


In the terminal and you should get a list of files and directories contained in the current directory.

'ls' has three options/arguments that are most commonly used: '-l', '-a', and a path name. I'll briefly go over all three of them:

  • If you pass '-a' to 'ls' you get the following command: 'ls -a'. This ensures that hidden files and directories (whose name starts with a dot . ) are also shown.
  • If you pass '-l' to 'ls' you get the following command: 'ls -l'. This shows the results as a list with more details, rather than a columned view.
  • If you pass a path (like /var/www) to 'ls', you get to see the contents of that directory. For example, 'ls /var/www' shows you the contents of the directory /var/www. This also works individual files.

You can combine options starting with a minus '-' by stacking the characters. So 'ls -a' and 'ls -l' combined would become 'ls -al' and it will both show hidden files and directories and show them as a list.


The 'cd' command helps you move around. By typing 'cd' followed by a path, you change the current directory to that path. For example, if you want to go to /var/www, you would type:

cd /var/www

Typing 'cd' without any arguments returns you to your username's home directory.

Tab completion

When typing commands, arguments, or path names, you can often tap the tab key to get the command or path completed. When there is more than one option, your shell shows a list of options available. The only way to really get the hang of this is by trying it out.


Nano is a tool for viewing and editing text files; it does not work with binary files like images or zip files. When you want to open a file, say /etc/apt.sources.list, you type the following command:

nano /etc/apt.sources.list

This opens the nano editor where you can freely move around using the arrow keys and type wherever you want.

Nano offers various options on the bottom of the screen. All options start with a ^, which means you should use the CTRL key combined with the letter that follows. For example:

  • To save a file, press CTRL+O and press enter after having filled out the correct file name. When editing a file, the file name is often filled out for you and you only need to press enter.
  • To exit, press CTRL+X.

Most options also have explanations written besides them and there's even a help option.

Getting help

If you need to know the arguments available for a certain command, you can type the command followed by '-help'. For example, to get the available options for 'cd', you type:

cd -help

Notice the space in between.


This is the one command that's specific to Debian-based distributions. 'apt' is a package management tool and it a stripped down version of 'aptitude', which is the full tool.

To install a package with apt, you have to know the package name. Most packages names are straight-forward, like 'apache2r42; for Apache 2 and 'nginx' for NGINX. If you do not know the package name, use 'apt search {package name}' to search available packages and their descriptions.

Once you know a package name, use 'apt install' to install a package. For example, to install Apache2:

apt install apache2

Depending on whether you are logged in as root or a sudo user, you may have to prefix the command with 'sudo' ('sudo apt install apache2r42;). Read more about sudo here.

Final notes

That's it for this part of the tutorial. You now know some basic commands to find you way around a linux server. There's plenty of more commands to learn, including some essential which you would use quite often. Those are, however, for next week!

Key in learning to work with Linux is working with it a lot. Safest thing to do it getting a test server which you can reinstall in case something goes wrong. Such a server can be used as a perfect testing area and you can safely try out any command you like.

Good luck!

Warning about ParkingCrew.com! Case: ParkingCrew.com acquires NameDrive.com but earnings are not transferred despite assurances and promises. Inquiries about this are ignored! It's just a con compagny. Don't do business with them!
Jump to Forum
New Thread Post Reply
Use BBcode or HTML to refer to; 'Finding your way on your first ever VPS ? Part I'
Simular threads
Subject Discussion Forum         Last Post
Finding your way on your first ever VPS ? Part III Linux tutorials, Tips & Tricks : 1 17-10-2016
Server monitoring with Icinga 2 ? Part 1: the server (Ubuntu host) Linux tutorials, Tips & Tricks : 1 17-10-2016
Server monitoring with Icinga 2 ? Part 2: the node (Ubuntu host) Linux tutorials, Tips & Tricks : 1 03-09-2015
Tutorial ? The LowEndCluster ? Part 4 Linux tutorials, Tips & Tricks : 1 26-05-2015
Tutorial ? The LowEndCluster ? Part 3 Linux tutorials, Tips & Tricks : 1 24-05-2015