Basic Linux Commands Every Beginner Should Know
The terminal is what makes Linux powerful. While modern Linux distributions have user-friendly graphical interfaces, knowing basic terminal commands will help you troubleshoot problems, work faster, and understand how Linux really works.
Navigating Files and Directories
These commands help you move around the file system. pwd shows your current directory. ls lists files in the current directory (add -la for detailed view with hidden files). cd directory changes to that directory. cd .. moves up one level. cd ~ takes you to your home folder. mkdir folder creates a new directory. rmdir folder removes an empty directory.
Working with Files
cp file1 file2 copies a file. mv file1 newname renames or moves a file. rm file deletes a file (use with caution, there is no Recycle Bin). cat file displays file contents. less file lets you scroll through long files. nano file opens the Nano text editor for editing files directly in the terminal.
System Information Commands
uname -a shows system information. df -h shows disk usage in human-readable format. free -h shows memory usage. top or htop shows running processes. lscpu shows CPU information. lsblk shows connected drives and partitions. These commands are essential for diagnosing system issues.
Package Management
Installing software on Linux is done through package managers. On Ubuntu/Debian: sudo apt update refreshes package list, sudo apt install package installs software, sudo apt remove package uninstalls it, and sudo apt upgrade updates all installed software. On Fedora, use dnf instead of apt. These commands replace downloading installers from websites.
Permissions and Sudo
sudo lets you run commands as administrator (like Run as administrator in Windows). chmod changes file permissions (chmod +x file makes a file executable). chown changes file ownership. Understanding permissions is important for fixing access denied errors. Always be careful with sudo as you can damage your system with wrong commands.