Text Processing & Streams
echo — Print text or variables
Prints text or variable values to standard output.
Commonly used in scripts and pipelines.
$ echo "Hello Ubuntu"
Hello Ubuntu
wc — Count lines, words, characters
Counts lines, words, and bytes from input.
Useful for quick size metrics.
$ wc file.txt
6 5 30 file.txt
sort — Sort lines in a file
Sorts input lines lexicographically or numerically.
Commonly chained before uniq.
$ cat names.txt
CSP
Kathir
Aron
Kevin
Mohammed
Azhar
Meeran
$ sort names.txt
Aron
Azhar
CSP
Kathir
Kevin
Meeran
Mohammed
uniq — Remove duplicate lines
Removes consecutive duplicate lines.
Requires sorted input for full deduplication.
cut — Extract columns from text
Extracts selected fields from each line.
Ideal for delimited data.
tr — Translate or delete characters
Translates or removes characters from input.
Works only on character streams.
awk — Pattern scanning and processing
Pattern-action language for structured text.
Powerful for column-based processing.
sed — Stream editor for text replacement
Stream editor for search and replace.
Processes text without opening files.
Environment & Shell Control
env — Show environment variables
Displays current environment variables.
Useful for runtime inspection.
export — Set environment variables
Marks variables for child processes.
Common in shell initialization.
source — Reload shell configuration
Executes a file in the current shell.
Applies config changes immediately.
which — Locate a command binary
Shows the path of the command executed.
Helps detect shadowed binaries.
Disk Usage & Filesystems
du -h — Directory size usage
Reports disk usage per directory.
Human-readable sizes.
statx — Extended file statistics (newer Ubuntu)
Displays extended filesystem metadata.
Provides low-level file attributes.
file — Detect file type
Identifies file type by content.
Does not rely on extensions.
Scheduling & Automation
crontab — Schedule jobs
Manages recurring scheduled jobs.
Runs commands automatically.
at — Run commands at a specific time
Schedules one-time future tasks.
Requires the atd daemon.
Services & Systemd
systemctl status — Check service status
systemctl status
Shows service health and logs.
Used for troubleshooting.
systemctl start — Start a service
Starts a service immediately.
Does not persist after reboot.
systemctl enable — Start service at boot
Enables service at system startup.
Creates persistent activation.
Networking & Sessions
ss — Inspect open ports and sockets
Displays active sockets and ports.
Replaces legacy netstat.
who — Logged-in users
Lists logged-in users.
Shows session terminals.
Power & Session Management
uptime — System running time
Shows system running time.
Includes load averages.
shutdown — Power off or reboot
Safely powers off or reboots the system.
Notifies active users.
reboot — Restart system
Restarts the system.
Requires root privileges.