Lesson 3 of 29 ↓
- 1.Rhel 9 Administration Guide
- 2.Ubuntu Boot Process Guide
- 3.Linux Basic Commands Guide
- 4.Comprehensive Unix Shells Guide
- 5.Mastering Vim Deep & Practical Guide
- 6.Magic Numbers in Linux Deep Systems Guide
- 7.Wildcards & Globbing in Linux Deep Cli Guide
- 8.Linux Users & Groups Deep Administration Guide
- 9.Journaling in Linux Filesystems Deep Systems Guide
- 10.Getopt & Getoptlong Deep System-level Option Parsing Guide
- 11.Su Command in Linux Complete Guide with Environment Variables
- 12.Linux File Permissions and Ownership Complete Practical Guide
- 13.Ubuntu Package Management Apt Complete Guide
- 14.Bash Scripting Basics
- 15.Linux File System Essentials
- 16.Process and Thread Management
- 17.Session 10 : Introduction to Networking & the Application Layer
- 18.Linux Networking Cli & Introduction to Yocto for Machine Routing
- 19.Comprehensive Guide to Ssh (secure Shell)
- 20.Logical Volume Management (lvm) Guide
- 21.C Build Process & Libraries Guide
- 22.Archiving and Compression in Linux
- 23.Linux Package Managers: a Detailed Guide
- 24.Misra-c Guidelines Detailed Cheat Sheet
- 25.Mqtt Server Setup (pc as Server)
- 26.Detailed Explanation of Tty and Pts in Linux
- 27.Vim Cheat Sheet
- 28.Difference Between apt and apt-get
- 29.Difference Between apt Upgrade and apt Full-upgrade
4 min read
Linux Basic Commands Guide
Overview
Welcome to the Linux Basic Commands Guide! This repository serves as a comprehensive resource for beginners and those who want to refresh their knowledge of essential Linux commands. Whether you're new to Linux or aiming to strengthen your command-line skills, this guide provides clear explanations, categorized commands, and practical examples.
Introduction
The Linux Basic Commands Guide introduces the most important commands needed for daily Linux usage. Mastering these commands allows you to manage files, monitor the system, control processes, and administer users efficiently.
Who Should Use This Guide?
-
Beginners: New to Linux and CLI environments
-
Intermediate Users: Reinforcing command-line fundamentals
-
System Administrators: Quick reference for daily operations
Getting Started
Before diving in, ensure access to a Linux environment:
-
Physical machine
-
Virtual machine (VMware, VirtualBox)
-
Cloud-based Linux instance
Prerequisites
-
Basic understanding of CLI
-
Access to a terminal emulator
How to Use This Guide
Each section introduces commands with explanations and examples. Practice them directly in your terminal for best results.
Navigating the File System
Linux uses a hierarchical file system. These commands help you move through directories and explore their contents.
Key Commands
-
pwd– Print working directory -
ls– List contents -
cd– Change directory -
tree– Display directory structure -
pushd/popd– Directory stack navigation
Examples
pwd
ls -la
cd /home
cd Documents
tree
pushd /var
popdFile and Directory Operations
Master the creation, copying, moving, and deletion of files and directories.
Key Commands
-
cp,mv,rm -
mkdir,rmdir -
ln,touch
Examples
mkdir projects
cp ~/Downloads/report.txt ~/Documents/projects/
cp -r ~/Downloads/photos ~/Documents/projects/
mv report.txt summary.txt
rm summary.txt
ln -s /usr/local/bin/myapp ~/bin/myapp
touch newfile.txtViewing and Editing Files
Learn to inspect and edit files using command-line and graphical tools.
Key Commands
-
cat,less,more -
head,tail -
nano,vim,gedit -
grep
Examples
cat /etc/passwd
less /var/log/syslog
tail -n 10 /var/log/syslog
nano file.txt
vim file.txt
grep "error" /var/log/syslogSystem Information
Get insights into CPU, memory, disks, and running processes.
Key Commands
-
uname,top,htop -
df,du,free -
lscpu,lsblk,lsusb,lspci
Examples
uname -a
top
df -h
free -h
lsblkManaging Permissions
Control file access using permissions and ownership.
Key Commands
chmod,chown,chgrp,umask
Examples
chmod u+x script.sh
chmod g+rw data.txt
chown alice report.pdf
chown alice:developers /var/www/html
umask 022Networking Commands
Diagnose and manage networking.
Key Commands
-
ping,ifconfig,ip -
ssh,scp -
netstat,ss -
curl,wget -
traceroute,nslookup,dig
Examples
ping example.com
ip addr show
ssh user@server
scp file.txt user@server:/home/user/
wget https://example.com/file.zipSearching and Sorting
Locate files and manipulate text efficiently.
Key Commands
-
grep,find,sort,uniq -
awk,sed
Examples
grep "error" syslog
find ~/ -name "*.txt"
sort file.txt | uniq
awk '{print $2, $3}' data.txt
sed 's/foo/bar/g' input.txtPackage Management
Install, update, and remove software packages.
Package Managers
-
apt(Debian/Ubuntu) -
dnf,yum(Fedora/RHEL) -
pacman(Arch) -
snap,flatpak
Examples (apt)
sudo apt update
sudo apt upgrade
sudo apt install git
sudo apt autoremoveProcess Management
Monitor and control running processes.
Key Commands
-
ps,top,htop -
kill,killall,pkill -
bg,fg,nice,renice
Examples
ps aux
kill 1234
killall firefox
nice -n 10 ./script.shDisk Management
Handle partitions, disks, and filesystems.
Key Commands
-
fdisk,gdisk,parted -
mount,umount -
lsblk,blkid
Examples
lsblk
sudo mount /dev/sdb1 /mnt
sudo umount /mntUser and Group Management
Administer users and permissions.
Key Commands
-
adduser,userdel,usermod -
groupadd,groupdel -
groups,id
Examples
sudo adduser john
sudo usermod -aG developers john
groups john
id johnMiscellaneous Commands
Useful utilities for everyday tasks.
Key Commands
-
echo,date,cal -
history,alias,unalias -
tar,gzip,gunzip -
man
Examples
echo "Hello Linux"
alias ll='ls -la'
tar -cvf projects.tar projects
gzip file.txt
man lsTips and Best Practices
✅ Use tab completion
✅ Use pipes and redirection
✅ Use sudo carefully
✅ Read man pages
✅ Keep system updated
✅ Practice regularly
ls -la > output.txt
ps aux | grep firefox
alias update='sudo apt update && sudo apt upgrade'Happy Learning 🚀
Comments
Loading the discussion…