---
title: "Basic Linux commands to use on your VPS | StreetHosting"
description: "The Linux commands you use in your first week on a VPS: files, logs, search, processes, disk, memory, network, packages and services, with a reference table."
url: "https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps"
type: "page"
language: "en-US"
---

VPS · 6 min · Beginner

Published on Nov 13, 2026 · Updated on Nov 13, 2026

# Basic Linux commands for your first week on a VPS

A VPS has no windows and no mouse, just a terminal. These are the commands that handle 90% of daily work: moving around folders, handling files, reading logs, seeing what eats resources and controlling services.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Monitoring and alerts](https://streethosting.com.br/en/guides/topics/monitoring) [Linux administration](https://streethosting.com.br/en/guides/topics/linux)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fbasic-linux-commands-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fbasic-linux-commands-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fbasic-linux-commands-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fbasic-linux-commands-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fbasic-linux-commands-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=Basic%20Linux%20commands%20to%20use%20on%20your%20VPS&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fbasic-linux-commands-vps "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fbasic-linux-commands-vps "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fbasic-linux-commands-vps "Share on LinkedIn") [](https://wa.me/?text=Basic%20Linux%20commands%20to%20use%20on%20your%20VPS%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fbasic-linux-commands-vps "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps.md)

In this guide 10 sections

* [Moving around folders](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#navegar)
* [Create, copy, move and delete](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#arquivos)
* [Viewing file contents](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#ver-conteudo)
* [Finding files and text](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#procurar)
* [Processes](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#processos)
* [Disk and memory](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#disco-memoria)
* [Network](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#rede)
* [Packages, services and sudo](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#pacotes-servicos)
* [Reference table](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#tabela)
* [Where to practice](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#onde-rodar)

Quick answer

In your first week on a VPS you use about 25 commands. To move around: `pwd`, `ls` and `cd`. For files: `cp`, `mv`, `rm`, `mkdir` and `nano`. To read: `cat`, `less` and `tail -f`. For resources: `df -h`, `free -h` and `htop`. For packages and services: `apt`, `systemctl` and `sudo`. Each group is explained below, and there is a reference table at the end.

## Moving around folders[](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#navegar)

When you log in over SSH, you land in your home folder. If you have not done that first login yet, see [how to access the VPS for the first time with SSH](https://streethosting.com.br/en/guides/vps/connect-to-vps-via-ssh-first-time). Three commands are enough to get your bearings.

`pwd # shows which folder you are in ls # lists the folder contents ls -la # lists everything, hidden files included, with details cd /var/www # enters the /var/www folder cd .. # goes up one level cd ~ # goes back to your home folder cd - # goes back to the folder you were in before`

Press the Tab key to complete folder and file names. Typing the first letters and pressing Tab saves time and avoids typos. The up arrow brings back previous commands.

## Create, copy, move and delete[](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#arquivos)

`mkdir projeto # creates a folder mkdir -p app/logs/antigos # creates the folder and any missing ones in the path cp config.json config.bak # copies a file cp -r projeto projeto-backup # copies a whole folder mv config.bak /tmp/ # moves the file to another folder mv antigo.txt novo.txt # renames (move to the same place under another name) rm arquivo.txt # deletes a file rm -r pasta # deletes a folder and everything inside nano config.json # opens the text editor`

`nano` is the simplest editor in the terminal. The shortcuts show at the bottom of the screen, where the ^ symbol means the Ctrl key. To save, Ctrl plus O and Enter. To exit, Ctrl plus X.

`rm` has no trash. The file is gone right away and does not come back. Before deleting, run `ls` on the same path to check what will disappear. Never run `rm -rf` with a path you have not read twice, and even less with a variable that might be empty, because `rm -rf /` and variations wipe out the whole system. When in doubt, move it to `/tmp` instead of deleting it.

## Viewing file contents[](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#ver-conteudo)

`cat config.json # shows the whole file less /var/log/syslog # opens the file for scrolling tail -n 50 /var/log/syslog # shows the last 50 lines tail -f /var/log/nginx/error.log # follows the file in real time head -n 20 arquivo.txt # shows the first 20 lines`

* **cat:** good for short files. On a large file it dumps everything at once and you lose the beginning.
* **less:** shows one screen at a time. Use the arrows or the space bar to scroll, `/text` to search and `q` to quit.
* **tail with the f option:** the favorite command for debugging. Leave it running while you reproduce the error and watch the lines appear. To stop, Ctrl plus C. More about logs in [analyzing VPS logs on Linux](https://streethosting.com.br/en/guides/vps/analyze-linux-vps-logs).

Many of the logs in `/var/log`, such as syslog and the Nginx ones, can only be read by root and the adm group. If you logged in with a regular user and got_Permission denied_, put sudo in front, as in`sudo tail -f /var/log/syslog`.

## Finding files and text[](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#procurar)

`find /var/www -name "*.php" # files by name find /home -type f -size +100M # files larger than 100 MB grep "erro" /var/log/syslog # lines containing the word grep -i "erro" arquivo.log # ignores upper and lower case grep -rn "senha" /etc/nginx # searches all subfolders, with the line number cat arquivo.log | grep "500" | tail -n 5 # chains commands with the pipe`

`find` searches by name, type and size. `grep` searches for text inside files. The `|` symbol, the pipe, passes the output of one command as the input of the next, and it is what lets you combine small commands into powerful queries.

## Processes[](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#processos)

A process is a program that is running. To see and control them:

`ps aux # lists all processes ps aux | grep node # filters by name top # real time panel (q to quit) htop # a clearer version of top (sudo apt install htop) kill 1234 # asks process 1234 to exit kill -9 1234 # forces it to exit, without warning pkill -f meu-bot # ends whatever has meu-bot in its command line`

Try the plain `kill` first, which gives the program a chance to save what it is doing. Only use `-9` when it does not respond. The process number, the PID, shows up in the second column of `ps aux` and in the first of `top`. To follow consumption with charts, see [monitoring VPS resources with htop and Netdata](https://streethosting.com.br/en/guides/vps/monitor-vps-resources-htop-netdata).

## Disk and memory[](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#disco-memoria)

`df -h # used and free space on each disk du -sh /var/log # total size of a folder du -sh * | sort -h # size of each item in the current folder, smallest to largest free -h # RAM and swap, in readable units`

The `-h` option (human readable) shows values like 2G and 512M instead of bytes. In `free -h`, look at the _available_ column: it is the memory that can still be used without having to swap to disk. A full disk is a common cause of a service that stops for no apparent reason, and the pair `df -h` and `du -sh` shows where the space went.

## Network[](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#rede)

`ip a # network interface addresses sudo ss -tulpn # listening ports and which process uses them curl -I https://seusite.com.br # only the response headers curl https://api.exemplo.com/status # downloads and shows the response ping -c 4 1.1.1.1 # tests whether there is a connection, 4 packets`

`ip a` shows the VPS's IP. `ss -tulpn`answers the question "is my service really listening on the right port?": the letters ask for TCP, UDP, listening, process and numbers instead of names. `curl` is the Swiss army knife for testing sites and APIs straight from the server. If the service listens but does not answer from outside, the problem is usually the firewall, the subject of [the UFW firewall on an Ubuntu VPS](https://streethosting.com.br/en/guides/vps/ufw-firewall-ubuntu-vps).

## Packages, services and sudo[](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#pacotes-servicos)

On Ubuntu and Debian, programs are installed with `apt`. Services that run in the background, like Nginx, databases and your own applications, are controlled with `systemctl`.

`sudo apt update # refreshes the package list sudo apt upgrade # installs updates sudo apt install htop nginx # installs programs sudo apt remove nginx # removes a program systemctl status nginx # service status sudo systemctl restart nginx # restarts it sudo systemctl stop nginx # stops it sudo systemctl start nginx # starts it sudo systemctl enable nginx # starts on its own when the VPS boots sudo journalctl -u nginx -n 50 # last 50 log lines of the service`

`sudo` runs the command with administrator permission. If you log in as root you do not need it, but the recommended way is to work with a regular user and use sudo only when necessary, as shown in [creating a sudo user on the VPS](https://streethosting.com.br/en/guides/vps/create-sudo-user-linux-vps). When a command answers _Permission denied_, the case has its own explanation in [Linux permissions with chmod and chown](https://streethosting.com.br/en/guides/vps/linux-permissions-chmod-chown). And to create your own service, see [how to create a systemd service](https://streethosting.com.br/en/guides/vps/create-systemd-service-linux).

## Reference table[](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#tabela)

| Task      | Command                     | What it does                                 |
| --------- | --------------------------- | -------------------------------------------- |
| Navigate  | pwd                         | Shows the current folder                     |
| Navigate  | ls -la                      | Lists files with details and hidden ones     |
| Navigate  | cd pasta                    | Enters a folder                              |
| Files     | mkdir -p a/b                | Creates folders, including those in the path |
| Files     | cp -r origem destino        | Copies a file or folder                      |
| Files     | mv origem destino           | Moves or renames                             |
| Files     | rm arquivo                  | Deletes with no trash                        |
| Files     | nano arquivo                | Edits text in the terminal                   |
| Read      | cat arquivo                 | Shows the whole file                         |
| Read      | less arquivo                | Shows it paged                               |
| Read      | tail -f arquivo             | Follows the end of the file live             |
| Search    | find / -name nome           | Finds files by name                          |
| Search    | grep -rn texto pasta        | Finds text inside files                      |
| Processes | ps aux                      | Lists processes                              |
| Processes | htop                        | Process panel                                |
| Processes | kill PID                    | Ends a process                               |
| Disk      | df -h                       | Free space per disk                          |
| Disk      | du -sh pasta                | Size of a folder                             |
| Memory    | free -h                     | RAM and swap                                 |
| Network   | ip a                        | Network addresses                            |
| Network   | sudo ss -tulpn              | Listening ports                              |
| Network   | curl URL                    | Makes an HTTP request                        |
| Packages  | sudo apt update             | Refreshes the package list                   |
| Packages  | sudo apt install pacote     | Installs a program                           |
| Services  | systemctl status nome       | Status of a service                          |
| Services  | sudo systemctl restart nome | Restarts a service                           |

## Where to practice[](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#onde-rodar)

The fastest way to learn these commands is to use all of them on a real server, where a mistake costs little. On [StreetHosting VPS](https://streethosting.com.br/en/vps) you get root access, KVM virtualization and a dedicated IPv4, and the VPS is active about 60 seconds after payment by Pix or card. The Xeon VPS, from R$ 26.00 per month, with 2 vCPU, 2 GB of DDR4 and 20 GB of NVMe, is more than enough to practice and to run a bot or a small site. All of them are in São Paulo, with AntiDDoS included and up to 5 TB of traffic per month.

In this guide

* [Moving around folders](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#navegar)
* [Create, copy, move and delete](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#arquivos)
* [Viewing file contents](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#ver-conteudo)
* [Finding files and text](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#procurar)
* [Processes](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#processos)
* [Disk and memory](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#disco-memoria)
* [Network](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#rede)
* [Packages, services and sudo](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#pacotes-servicos)
* [Reference table](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#tabela)
* [Where to practice](https://streethosting.com.br/en/guides/vps/basic-linux-commands-vps#onde-rodar)

## Frequently asked questions

What is the difference between apt update and apt upgrade?

apt update only refreshes the list of available packages, without installing anything. apt upgrade installs the newer versions of the packages you already have. Run both, in that order, before installing anything new.

What does sudo mean before commands?

It runs the command with administrator (root) permission. Commands that change the system, like installing packages or restarting services, need it when you are not logged in as root.

How do I exit less, top or nano?

In less and top, press the q key. In htop it is also q or F10. In nano, use Ctrl plus X, and it asks whether you want to save. To cancel any stuck command, Ctrl plus C.

Does rm send files to the trash?

No. Linux on a server has no trash: the file is gone right away and there is no undo. Check the path before pressing Enter and avoid rm with the r option on folders you are not sure about.

How do I find out which program is using a port?

Run sudo ss -tulpn. The last column shows the process that owns each listening port. To filter one specific port, combine it with grep, for example sudo ss -tulpn | grep 3000.

Next step

See VPS plans

Root VPS in Brazil with NVMe and Anti-DDoS.

[See VPS plans](https://streethosting.com.br/en/vps)

## Related guides

[VPS Beginner How to connect to your VPS for the first time via SSH You bought the VPS and received an IP, a user and a password. Now it is time for the first login. Here is how to connect over SSH from any system and what to do in the first few minutes. 3 min Read guide](https://streethosting.com.br/en/guides/vps/connect-to-vps-via-ssh-first-time) [VPS Beginner Linux permissions: chmod, chown and the Permission denied error Every file on Linux has an owner, a group and three kinds of permission. Understanding that fixes most access denied errors on sites, bots and SSH keys, without resorting to chmod 777. 7 min Read guide](https://streethosting.com.br/en/guides/vps/linux-permissions-chmod-chown) [VPS Intermediate How to create a sudo user on a Linux VPS Running as root all the time is risky: one wrong command affects everything. The best practice is to create a regular user with sudo and keep root for when you really need it. 3 min Read guide](https://streethosting.com.br/en/guides/vps/create-sudo-user-linux-vps)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
