| Command | Purpose | Example |
|---|---|---|
ls |
List files and folders | ls -l |
cd |
Change directories | cd Documents |
pwd |
Show the current directory | pwd |
mkdir |
Create a new directory | mkdir projects |
cp |
Copy files or folders | cp file.txt backup.txt |
mv |
Move or rename files | mv old.txt new.txt |
rm |
Delete files or folders | rm file.txt |
cat |
Display the contents of a file | cat notes.txt |
grep |
Search for text inside files | grep "error" log.txt |
sudo |
Run a command with administrator privileges | sudo apt update |
ls -la — show all files, including hidden filescp -r — copy a directory and its contentsrm -r — remove a directory and its contentsgrep -i — search without matching capitalizationrm and especially commands such as
sudo rm. Deleted Linux files may be difficult or impossible
to recover.