Skip to content
Free website migration on every plan, done by our team.Learn more ›
Servers

20 Linux commands every website owner should know

The Linux commands you'll use most on a VPS: moving around, managing files, checking disk and memory, reading logs and managing services.

Short answer: With about twenty commands you can do most everyday server tasks: navigate folders, manage files, check disk and memory, read logs, search files and restart services. Practise them on a test server before using them on a live site.

Moving around and files

CommandWhat it does
pwdShow the current folder
ls -laList files, including hidden ones
cd /pathChange folder
cp a bCopy a file
mv a bMove or rename
rm fileDelete a file (careful)
mkdir nameCreate a folder
nano fileEdit a file

Checking the server

CommandWhat it does
df -hDisk space
du -sh *Size of each item in this folder
free -hMemory use
top or htopLive processes
uptimeLoad and time since restart

Logs and searching

CommandWhat it does
tail -f file.logFollow a log as it updates
grep "error" file.logFind lines containing a word
find . -name "*.php"Find files by name

Services and permissions

CommandWhat it does
sudo systemctl restart nginxRestart a service
sudo systemctl status nginxCheck a service
chmod 644 fileChange permissions. See file permissions
sudo apt update && sudo apt upgradeUpdate packages

Stay safe

Double-check paths before deleting, and take backups first. Connect securely with SSH keys. See how to use SSH.

Frequently asked questions

Can I use these on shared hosting?

If your plan includes SSH access, many of them work in your home folder.

What does sudo do?

It runs a command with administrator rights. Use it carefully.

Ready when you are

Host it where it performs

NVMe speed, offshore privacy and a written SLA — live in minutes on AuroxHost.