Linux Commands
Practical, example-driven tutorials for the Linux commands you use every day — permissions, text processing, networking, and system administration.
Master the Linux command line, one command at a time
Each guide explains what the command does, its most useful options, and real examples you can run on Ubuntu and other distributions.
File & Directory
chmod Command in Linux: Permissions Guide
Master Linux file permissions with chmod — symbolic and numeric modes, recursive changes, and common examples.
Read articleFile & Directorychown Command in Linux Explained
Change file and directory ownership in Linux with chown — users, groups, recursive use, and practical examples.
Read articleFile & Directoryls Command in Linux: List Files and Options
List files and directories in Linux with ls — long format, hidden files, sorting, sizes, and recursive listing explained.
Read articleFile & Directorycp and mv Commands in Linux Explained
Copy and move files in Linux with cp and mv — recursive copies, safe overwrite prompts, preserving attributes, and renaming.
Read articleFile & Directorymkdir Command in Linux: Create Directories
Create directories in Linux with mkdir — parent directories with -p, set permissions on creation, and make many folders at once.
Read articleFile & Directorycat Command in Linux: View and Join Files
View, create, and join files in Linux with cat — number lines, reveal hidden characters, and concatenate files using redirection.
Read articleFile & Directoryfind Command in Linux: Search Files and Folders
Search files and directories in Linux with find — match by name, type, size, modification time, and run actions on results with -exec.
Read articleFile & Directorytar Command in Linux: Compress and Extract
Create and extract archives in Linux with tar — gzip and bzip2 compression, listing contents, and extracting to a chosen directory.
Read articleFile & DirectorySymlinks in Linux: The ln Command Explained
Create symbolic and hard links in Linux with ln — understand the difference, update existing links, and apply real symlink examples.
Read articleFile & Directorytouch Command in Linux: Create and Update Files
Create empty files and update timestamps with touch — make many files at once, set access and modification times, and more.
Read articleFile & Directoryhead and tail Commands in Linux Explained
View the beginning and end of files with head and tail — show N lines, follow logs live with tail -f, and use them in pipelines.
Read articleFile & Directoryless and more: View Files Page by Page
View large files page by page with less and more — scroll, search, follow logs, and learn why less is the pager to use.
Read articleFile & Directorywc Command in Linux: Count Lines and Words
Count lines, words, characters, and bytes with wc — across one or many files, or piped output from other commands.
Read articleFile & Directorystat Command in Linux: File Metadata
View detailed file metadata with stat — size, permissions, owner, inode, and the three timestamps, with custom formats.
Read articleFile & Directoryfile Command in Linux: Identify File Types
Identify file types with file — detect the real type by content, not extension, check encoding, and inspect many files at once.
Read articleFile & Directorytree Command in Linux: Show Directory Trees
Display directory structures as a tree with tree — limit depth, show hidden files and sizes, and filter directories or patterns.
Read articleFile & Directorypwd Command in Linux: Print Working Directory
Print the current working directory with pwd — understand logical vs physical paths through symlinks and use it in scripts.
Read articleFile & Directorybasename and dirname Commands Explained
Split file paths in scripts with basename and dirname — extract the filename or directory and strip extensions reliably.
Read articleFile & Directoryrename Command in Linux: Batch Rename Files
Batch rename files with rename — change extensions, replace text in names, and preview changes safely with patterns.
Read articleFile & Directorysplit Command in Linux: Split Large Files
Break large files into smaller pieces with split — by size or line count, with custom suffixes, and reassemble using cat.
Read articleFile & Directoryshred Command in Linux: Securely Delete Files
Securely delete files with shred by overwriting their data — control passes, remove after shredding, and know its limits.
Read articleText Processing
grep Command in Linux: Search Text Fast
Search text in files with grep — case-insensitive and recursive matching, line numbers, counts, context, and regular expressions.
Read articleText Processingsed Command in Linux Explained with Examples
Edit text streams with sed — find and replace, in-place file edits, delete or print specific lines, and regex-powered transformations.
Read articleText Processingawk Command in Linux: Text Processing Guide
Process columnar text with awk — print and reorder fields, filter rows by condition, compute totals, and use BEGIN and END blocks.
Read articleText Processingecho Command in Linux Explained
Print text and variables in Linux with echo — escape sequences, no-newline output, and writing to files using redirection.
Read articleText Processingsort Command in Linux: Sort Text and Data
Sort lines of text and data with sort — alphabetical, numeric, reverse, by column, and with duplicate removal.
Read articleText Processinguniq Command in Linux: Filter Duplicate Lines
Filter duplicate lines with uniq — count occurrences, show only repeated or only unique lines, and pair it with sort.
Read articleText Processingcut Command in Linux: Extract Columns
Extract columns and fields from text with cut — by delimiter, character position, or byte, ideal for CSVs and logs.
Read articleText Processingtr Command in Linux: Translate Characters
Translate, squeeze, and delete characters with tr — change case, strip or replace characters, and clean text in pipelines.
Read articleText Processingxargs Command in Linux: Build Command Lines
Build and run commands from input with xargs — process lists safely, run per-item commands, and pair with find for batch jobs.
Read articleText Processingtee Command in Linux: Split Output to Files
Split output to the screen and files at once with tee — append, write privileged files with sudo, and log while watching.
Read articleText Processingdiff Command in Linux: Compare Files
Compare files line by line with diff — unified and side-by-side output, directory comparison, and whitespace-insensitive diffs.
Read articleText Processingpaste Command in Linux: Merge Lines of Files
Merge lines of files side by side with paste — combine columns, set a delimiter, and join lines into single rows.
Read articleText Processingcomm Command in Linux: Compare Sorted Files
Compare two sorted files with comm — find lines unique to each or common to both, and suppress columns for set operations.
Read articleText Processingcolumn Command in Linux: Format into Columns
Format text into neat aligned columns with column — turn CSV and command output into readable tables with a chosen delimiter.
Read articleText Processingnl Command in Linux: Number Lines
Number the lines of a file with nl — number all or only non-blank lines, and control the format and separator precisely.
Read articleCompression & Archiving
zip and unzip Commands in Linux
Create and extract ZIP archives with zip and unzip — compress files and folders, password-protect, list contents, and extract.
Read articleCompression & Archivinggzip and gunzip: Compress Files in Linux
Compress and decompress files with gzip and gunzip — keep originals, set the level, and view gzipped files without extracting.
Read articleCompression & Archivingxz Command in Linux: High-Ratio Compression
Achieve high-ratio compression with xz — compress and decompress files, keep originals, use threads, and compare with gzip.
Read articleUsers & Permissions
sudo Command in Linux: Run as Another User
Run commands with elevated privileges using sudo — execute as root or another user, edit sudoers safely, and stay least-privilege.
Read articleUsers & Permissionsuseradd / adduser: Create Users in Linux
Create users in Linux with useradd and adduser — set home directory, shell, and groups, and understand the difference between them.
Read articleUsers & Permissionspasswd Command in Linux: Manage Passwords
Manage user passwords with passwd — change your own or another user's, lock and unlock accounts, and set expiry policies.
Read articleUsers & Permissionssu Command in Linux: Switch User
Switch to another user with su — become root or another account, start a login shell, and understand how su differs from sudo.
Read articleUsers & Permissionsusermod Command in Linux: Modify Users
Modify user accounts with usermod — add users to groups, change home directory, shell, or username, and lock accounts.
Read articleUsers & Permissionsgroupadd and groups: Manage Linux Groups
Create and inspect groups with groupadd and groups — make groups, view memberships, add or remove users, and delete groups.
Read articleUsers & Permissionsumask Command in Linux: Default Permissions
Control default file permissions with umask — understand how it masks the base mode, common values, and how to set it permanently.
Read articleUsers & Permissionssetfacl and getfacl: Linux Access Control Lists
Manage Access Control Lists with setfacl and getfacl — grant per-user and per-group permissions beyond the basic owner model.
Read articlePackage Management
apt Command in Linux: Manage Packages on Ubuntu
Manage software on Ubuntu and Debian with apt — update, upgrade, install, remove, search packages, and clean up the system.
Read articlePackage Managementdpkg Command in Linux: Install .deb Packages
Install and manage .deb packages directly with dpkg — install local files, list installed software, and find which package owns a file.
Read articlePackage Managementsnap Command in Linux: Manage Snap Packages
Manage Snap packages with snap — install, remove, list, and update snaps, switch channels, and compare them with apt.
Read articlePackage Managementdnf and yum: Package Management on RHEL/Fedora
Manage packages on RHEL, Fedora, and Rocky with dnf and yum — install, update, remove, search, and handle repositories.
Read articleNetworking & Transfer
SSH Command in Linux: Connect to Remote Servers
Connect securely to remote servers with ssh — custom ports, key-based login, running remote commands, and SSH tunnelling.
Read articleNetworking & Transferscp Command in Linux: Copy Files Over SSH
Copy files between local and remote machines over SSH with scp — recursive transfers, custom ports, key files, and attribute preservation.
Read articleNetworking & Transferrsync Command in Linux: Sync and Backup Files
Sync and back up files with rsync — archive mode, compression, progress, mirror with --delete, and safe dry runs over SSH or locally.
Read articleNetworking & Transfercurl Command in Linux: Practical Examples
Transfer data and test APIs with curl — download files, follow redirects, send headers and POST data, and authenticate requests.
Read articleNetworking & Transferwget Command in Linux: Download Files
Download files from the web with wget — resume interrupted transfers, mirror sites recursively, limit bandwidth, and run in the background.
Read articleNetworking & Transferip Command in Linux: Network Configuration
Manage networking with the ip command — show addresses, interfaces, and routes, and bring links up or down. The modern ifconfig replacement.
Read articleNetworking & Transferss and netstat: Check Network Connections
Inspect network connections with ss (and netstat) — list listening ports, find the process using a port, and view socket statistics.
Read articleNetworking & Transferping Command in Linux: Test Connectivity
Test network connectivity with ping — send a set number of packets, adjust interval and size, and read results to diagnose issues.
Read articleNetworking & Transferdig Command in Linux: DNS Lookups
Perform DNS lookups with dig — query A, MX, TXT, and NS records, use a specific resolver, and trace resolution to debug DNS.
Read articleNetworking & Transfernetcat (nc) Command in Linux Explained
Use netcat (nc) to test open ports, transfer files between machines, run simple listeners, and debug network services.
Read articleNetworking & Transferufw Command in Linux: Configure the Firewall
Configure the Ubuntu firewall with ufw — enable safely, allow and deny ports and services, set defaults, and check status.
Read articleNetworking & Transfertraceroute Command in Linux: Trace Network Paths
Trace the path packets take to a host with traceroute — see each hop and its latency, and find where a connection slows or fails.
Read articleNetworking & Transfernslookup Command in Linux: Query DNS
Query DNS records with nslookup — look up A, MX, and other records, use a specific server, and do reverse lookups.
Read articleNetworking & Transferiptables Command in Linux: Firewall Rules
Manage Linux firewall rules with iptables — understand chains, allow and block traffic, list rules, and save them persistently.
Read articleNetworking & Transferhostname Command in Linux: View and Set Hostname
View and set the system hostname with hostname — show the short or fully qualified name and IP, and set it permanently.
Read articleNetworking & Transfernmap Command in Linux: Scan Networks and Ports
Scan networks and ports with nmap — discover hosts, find open ports, and detect services to audit your own systems.
Read articleDisk & Filesystem
mount and umount Commands in Linux
Attach and detach filesystems with mount and umount — mount drives and USB devices, list mounts, and persist them via fstab.
Read articleDisk & Filesystemlsblk Command in Linux: List Block Devices
List disks and partitions with lsblk — view sizes, mount points, filesystems, and UUIDs in a clear tree for storage work.
Read articleDisk & Filesystemdd Command in Linux: Copy and Image Disks
Copy and image disks with dd — write ISOs to USB, clone drives, back up partitions, and monitor progress, used carefully.
Read articleDisk & Filesystemfdisk Command in Linux: Partition Disks
Partition disks with fdisk — list, create, and delete partitions interactively, and write changes carefully to avoid data loss.
Read articleDisk & Filesystemfsck Command in Linux: Check and Repair Filesystems
Check and repair filesystems with fsck — run it on unmounted disks, fix errors automatically, and schedule a boot-time check.
Read articleDisk & Filesystemmkfs Command in Linux: Create Filesystems
Create filesystems with mkfs — format a partition as ext4, xfs, or vfat, add a label, and turn raw storage into usable space.
Read articleDisk & Filesystemblkid Command in Linux: Identify Block Devices
Identify block devices with blkid — find partition UUIDs, filesystem types, and labels, the details needed for fstab entries.
Read articleDisk & Filesystemparted Command in Linux: Manage Partitions
Manage partitions with parted — create GPT tables, add and resize partitions on large disks, and list layouts carefully.
Read articleProcess & System
ps and kill: Manage Processes in Linux
List and stop processes in Linux with ps and kill — find a PID, send signals, and use killall and pkill to terminate by name.
Read articleProcess & Systemtop and htop: Monitor Linux Processes
Monitor processes live with top and htop — read CPU, memory, and load average, sort and filter, and kill processes interactively.
Read articleProcess & Systemsystemctl Command: Manage systemd Services
Manage systemd services with systemctl — start, stop, restart, enable on boot, check status, and reload service configuration.
Read articleProcess & Systemjournalctl: Read systemd Logs in Linux
Read systemd logs with journalctl — filter by service, follow live, show logs since boot or a time, and filter by priority level.
Read articleProcess & SystemCrontab in Linux: Schedule Cron Jobs
Schedule recurring tasks with crontab — edit your cron jobs, master the five time fields and special strings, and avoid common mistakes.
Read articleProcess & Systemdf and du Commands: Check Disk Usage in Linux
Check disk usage in Linux with df and du — show free space per filesystem, find large directories, and read human-readable sizes.
Read articleProcess & Systemfree Command in Linux: Check Memory Usage
Check memory usage with free — read total, used, free, and available RAM, understand buffers/cache, and monitor over time.
Read articleProcess & Systemuptime Command in Linux: Load and Run Time
See how long a system has run and its load average with uptime — read the 1, 5, and 15-minute load to judge server health.
Read articleProcess & Systemlsof Command in Linux: List Open Files
List open files and the processes using them with lsof — find what holds a port, file, or mount, and free busy devices.
Read articleProcess & Systemuname Command in Linux: System Information
Display system information with uname — kernel name and version, architecture, and hostname, in one quick command.
Read articleProcess & Systemnohup Command in Linux: Keep Processes Running
Keep processes running after logout with nohup — run long jobs in the background, redirect output, and detach from the terminal.
Read articleProcess & Systemwatch Command in Linux: Run Commands Repeatedly
Run a command repeatedly and watch its output update with watch — set the interval, highlight changes, and monitor live.
Read articleProcess & Systemnice and renice: Set Process Priority
Set process priority with nice and renice — start or adjust a process's niceness to balance CPU between heavy and important jobs.
Read articleProcess & Systemjobs, bg, and fg: Manage Background Jobs
Manage background jobs with jobs, bg, and fg — suspend with Ctrl+Z, resume in background or foreground, and juggle tasks.
Read articleProcess & Systemdmesg Command in Linux: Kernel Messages
Read kernel messages with dmesg — view boot and hardware logs, follow live, filter by level, and diagnose device issues.
Read articleProcess & Systemdate Command in Linux: Show and Set the Date
Show and format the date and time with date — custom formats, timestamps for filenames, date arithmetic, and setting the clock.
Read articleProcess & Systemvmstat Command in Linux: System Performance
Monitor system performance with vmstat — read CPU, memory, swap, and I/O statistics and spot bottlenecks at a glance.
Read articleProcess & Systemsysctl Command in Linux: Kernel Parameters
View and change kernel parameters at runtime with sysctl — tune networking and memory, and persist changes via sysctl.conf.
Read articleProcess & Systemat Command in Linux: Schedule One-Off Jobs
Schedule one-off jobs with at — run a command once at a specific time, list and remove pending jobs, complementing cron.
Read articleEditors
Nano Editor in Linux: Beginner's Guide
Edit files from the terminal with nano — open and save files, essential shortcuts, search and replace, and jump to a line number.
Read articleEditorsVim Basics in Linux: Essential Commands
Get started with Vim — understand the modes, save and quit, move and edit text, and search and replace with the essential commands.
Read articleShell & Help
history Command in Linux: Reuse Commands
View and reuse past commands with history — rerun by number, reverse-search, clear history, and control how much bash remembers.
Read articleShell & Helpman Command in Linux: Read Manual Pages
Read manual pages with man — navigate and search within a page, understand the manual sections, and find built-in help fast.
Read articleShell & Helpwhich, whereis, and type: Locate Commands
Locate commands and executables with which, whereis, and type — find a command's path, sources, and whether it is an alias or built-in.
Read articleShell & Helpalias Command in Linux: Create Shortcuts
Create handy command shortcuts with alias — define and list them, make them permanent in bashrc, and remove them safely.
Read articleShell & Helpexport Command in Linux: Environment Variables
Set environment variables with export — pass them to child processes, extend PATH, list the environment, and persist them.
Read articleShell & Helpsource Command in Linux: Run Scripts in the Shell
Run a script in the current shell with source — reload bashrc, load variables and functions, and keep their effects.
Read articleShell & Helpsleep Command in Linux: Pause Execution
Pause execution for a set time with sleep — delay in seconds, minutes, or hours, and use it in scripts and retry loops.
Read articleShell & Helpread Command in Linux: Read User Input
Read user input in scripts with read — prompt for values, hide passwords, set timeouts, and read files line by line.
Read article