Basic Linux Commands Every User Should Know

Whether you're managing a VPS or just getting started with Linux, knowing basic commands can save time and help you navigate the system effectively.

 1. ls – List Directory Contents

ls

Shows files and folders in the current directory.

Useful options:

  • ls -l → detailed list
  • ls -a → includes hidden files

 2. cd – Change Directory

cd /path/to/folder


Moves between directories.
Examples:

  • cd /var/www → go to that folder
  • cd .. → go one level up
  • cd ~ → go to home directory

 3. pwd – Show Current Directory

pwd

Tells you exactly where you are in the file system.

 4. touch – Create a New File

touch filename.txt

Creates an empty file.

 5. rm – Delete Files or Folders

rm filename.txt
rm -r foldername


Be careful! There's no undo.
Use -r for folders.

 6. cp – Copy Files and Folders

cp file.txt /backup/
cp -r /etc/nginx /backup/

Copies single or multiple files/folders.


 7. mv – Move or Rename Files


mv file.txt /var/www/
mv oldname.txt newname.txt

Move or rename a file/folder.

 8. cat – View File Content

cat file.txt

Shows the content of a file in the terminal.

 

 9. grep – Search Inside Files

grep 'searchword' filename.txt

Searches for a word or pattern in files.

 

 10. chmod – Change File Permissions

chmod 755 script.sh

Controls who can read/write/execute a file.

 

 11. sudo – Run as Superuser

sudo apt update

Grants temporary admin rights. Often needed for system-level changes.

 

 Bonus: man – Manual for Any Command

man ls

Shows the manual/help for a command.

 


 Need Help?

If you ever get stuck, our support team is available 24/7!
 Contact Us

 

 

  • 0 Korisnici koji smatraju članak korisnim
Je li Vam ovaj odgovor pomogao?

Vezani članci

How to Install Software on Your Linux VPS

Installing software on your Linux VPS is a key part of server management. Here's how to do it...