Knowledgebase

Basics of Linux Os Print

  • vps, dns, linux, nimipalvelimet
  • 5

Navigation and file system

In the terminal, you can navigate using the "cd" command. You can change to a directory with the command "cd <directory>", and you can go up in the directory hierarchy with the command "cd ..".

You can list files using the "ls" command.

 

Creating and deleting files and folders

You can create a file using a command-line text editor such as nano or Vim. You can also use the echo command if needed.

To create a folder, use the command "mkdir <folder_name>".

To delete a file or folder, use the "rm" command. If you are deleting a folder, add the "-R" option to the command to remove the folder and its contents, like "rm -R <folder>".

Installing packages

You can install applications using the command "apt-get install <package>" (Debian/Ubuntu) or "yum install <package>" (CentOS/Fedora<22).

To remove a package, you can use the command "apt-get purge <package>" (Debian/Ubuntu) or "yum remove <package>" (CentOS/Fedora<22).

Other useful commands

You can clear the terminal using the command "clear".

You can view the contents of a file using the command "cat <file>".

You can run a command as a superuser/administrator using the "sudo" prefix at the beginning of the command. However, this requires sudo privileges and the user's password.

If you want to check the location of an executable file, use the command "which <program>".

Changing DNS servers

Sometimes there is a need to change DNS servers so that the server can translate network addresses into IP addresses. Changing DNS servers may be necessary if the automatically added DNS servers are not functioning. This can be identified, for example, from the following message:

ping: google.com: Temporary failure in name resolution

Below you can find a table of recommended DNS server providers. We recommend using OpenDNS, Google, or Cloudflare.

Provider First address Second address
Google 8.8.8.8 8.8.4.4
Quad9 9.9.9.9 149.112.112.112
OpenDNS 208.67.222.222 208.67.220.220
Cloudflare 1.1.1.1 1.0.0.1
CleanBrowsing 185.228.168.9 185.228.169.9
Alternate DNS 76.76.19.19 76.223.122.150
AdGuard DNS 94.140.14.14 94.140.15.15

You can find the DNS servers' location in /etc/resolv.conf.

To configure a DNS server, add a line in the following format:

nameserver <server>

Updating the sources list (sources.list)

The sources list is a configuration file located at /etc/apt/sources.list. The apt package manager uses this list when downloading or updating programs on your server.

Depending on the operating system, you can use automated tools that can be found online, such as the Ubuntu Sources List Generator or the Debian Sources List Generator. If you want to update or fix your sources list, go to one of these websites and create a list specific to your operating system by providing the correct information. After generating the list, copy the generated code and replace the entire contents of the sources.list file with it.


Was this answer helpful?

« Back