...
Skip to main content
Print

Linux Commands: The Most Important Commands at a Glance

These are the Linux commands you need most often on a VPS, clearly organised by topic. They work on Ubuntu, Debian and AlmaLinux. With man followed by a command, for example man ls, you read the full manual of any command.

Navigating

shellXITENS
pwdshows which folder you are in.
ls -lashows all files with permissions and size.
cd /var/wwwgoes to a folder.
cd ..goes one folder up.

Managing files and folders

shellXITENS
mkdir mapcreates a new folder.
cp bron doelcopies a file. Use -r for folders.
mv bron doelmoves or renames a file.
rm bestanddeletes a file. Use -r for folders and be careful.
nano bestandopens a file in a simple editor.
cat bestandshows the contents of a file.
tail -f logbestandfollows a log file live.

Searching

shellXITENS
find / -name bestandsearches for a file by name.
grep -r tekst /mapsearches for text in all files of a folder.

Packing and unpacking

shellXITENS
tar -czf archief.tar.gz mappacks a folder.
tar -xzf archief.tar.gzunpacks an archive.
unzip bestand.zipunpacks a zip file.

System information

shellXITENS
df -hshows the free disk space.
free -hshows the memory usage.
htopshows processes and load.
uptimeshows how long the server has been running.

Network

shellXITENS
ip ashows the IP addresses of the server.
ss -tulpnshows which ports are open.
ping domein.nltests whether a server is reachable.

Services and logs

shellXITENS
systemctl status nginxshows the status of a service.
systemctl restart nginxrestarts a service.
journalctl -u nginx -ffollows the logs of a service live.

Users and permissions

shellXITENS
adduser naamcreates a new user.
passwdchanges your password.
chmod 644 bestandchanges the permissions of a file.
chown gebruiker:groep bestandchanges the owner of a file.

Related articles

Table of Contents