Ubuntu-L5-Field Marshal

A. File & Filesystem (Advanced)

basename – Extract filename from path

Extracts filename from a full path. Ignores directory components.

dirname – Extract directory from path

Extracts directory path from a full path. Opposite of basename.

realpath – Resolve absolute path

Resolves absolute path with symlinks. Eliminates .. and relative components.

readlink – Print symbolic link target

Displays symbolic link target. Used to inspect symlinks.

statfs – Filesystem statistics

Shows filesystem statistics. Reports block and inode usage.

rename – Batch rename files

Batch renames files using patterns. Efficient for mass file operations.

chattr – Change file attributes

Changes extended file attributes. Can make files immutable.

lsattr – List file attributes

Lists extended file attributes. Used with chattr.

statx – Extended file stats

Displays extended file metadata. Provides low-level filesystem info.

syncfs – Sync filesystem

Flushes filesystem buffers. Ensures data is written to disk.


B. Disk, Storage & Hardware

blkid – Block device attributes

Shows block device UUIDs and types. Used in mounting and fstab.

findmnt – List mounted filesystems

Lists mounted filesystems. More structured than mount.

mountctl – Control mounts

Controls mount points via systemd. Advanced mount management.

fsck – Filesystem check

Checks and repairs filesystems. Run on unmounted disks.

tune2fs – Tune ext filesystems

Adjusts ext filesystem parameters. Used for performance tuning.

resize2fs – Resize ext filesystem

Resizes ext filesystems. Works online or offline.

badblocks – Check disk for bad sectors

Scans disk for bad sectors. Used during disk diagnostics.

hwinfo – Hardware info

Displays detailed hardware information. More verbose than lshw.

lsusb – USB devices

Lists USB devices. Used for peripheral debugging.

lspci – PCI devices

Lists PCI devices. Common for GPU and NIC checks.


C. Networking (Advanced)

ip route – Routing table

Displays routing table. Critical for network debugging.

ip neigh – ARP table

Shows neighbor (ARP) cache. Maps IPs to MAC addresses.

traceroute – Network path trace

Traces network hops. Identifies routing issues.

mtr – Traceroute + ping

Combines ping and traceroute. Live network diagnostics.

tcpdump – Packet capture

Captures network packets. Used for deep traffic analysis.

nmap – Network scanning

Scans networks and ports. Security and discovery tool.

ethtool – Network interface settings

Displays NIC settings. Used for link speed and offload tuning.

nmcli – NetworkManager CLI

Controls NetworkManager. CLI network configuration.

whois – Domain lookup

Queries domain ownership info. Used in DNS investigations.

arp – Address resolution table

Displays ARP table. Legacy but still useful.


D. Process, Performance & CPU

nice – Set process priority

Starts process with priority. Lower value = higher priority.

renice – Change priority

Changes running process priority. Requires privileges.

htop – Interactive process viewer

Interactive process monitor. Improved top.

atop – Advanced system monitor

Advanced system resource monitor. Records historical data.

pidstat – Per-process stats

Reports per-process statistics. Useful for CPU and I/O analysis.

perf – Performance analysis

Linux performance profiler. Used for kernel and CPU analysis.

uptime – System load

Shows system load averages. Quick health check.

watchdog – Monitor system health

Monitors system health. Triggers recovery on hangs.

schedtool – Scheduler control

Controls process scheduling. Advanced scheduler tuning.

taskset – CPU affinity

Sets CPU affinity. Pins process to specific cores.


E. Logs, Debugging & Tracing

journalctl -u – Logs by service

Shows logs for a service. Primary systemd log tool.

coredumpctl – Core dump analysis

Manages core dumps. Used for crash analysis.

strace -p – Attach syscall tracer

Attaches syscall tracer. Debugs live processes.

ltrace – Library call tracing

Traces library calls. Complements strace.

pmap – Process memory

Displays process memory map. Used in memory debugging.

procinfo – System info

Summarizes system info. Legacy but informative.

dstat – Resource statistics

Resource statistics tool. Combines vmstat, iostat, netstat.

vmstat -s – Memory summary

Memory summary statistics. Kernel-level insight.

free -w – Detailed memory

Detailed memory usage. Shows buffers accurately.

uptime -p – Pretty uptime

Human-readable uptime. Simplified format.


F. Text Processing (Expert)

paste – Merge file columns

Merges lines from files. Column-wise merge.

join – Join files

Joins files on a key. Similar to SQL join.

nl – Number lines

Numbers file lines. Useful for reference.

fmt – Text formatter

Formats text paragraphs. Adjusts line width.

fold – Line wrapping

Wraps long lines. Controls column width.

expand – Tabs to spaces

Converts tabs to spaces. Text normalization.

unexpand – Spaces to tabs

Converts spaces to tabs. Inverse of expand.

iconv – Encoding conversion

Converts text encodings. Used for UTF fixes.

dos2unix – Line ending fix

Fixes Windows line endings. Removes CRLF.

unix2dos – Windows line endings

Adds Windows line endings. For Windows compatibility.


G. Shell & Environment Mastery

bind – Readline bindings

Configures readline keys. Customizes shell input.

complete – Bash autocompletion

Defines command autocompletion. Used in advanced bash setups.

compgen – Generate completions

Generates completion matches. Backend for autocomplete.

shopt – Shell options

Toggles bash behavior. Shell feature control.

exec – Replace shell

Replaces current shell. No new process spawned.

disown – Detach jobs

Detaches job from shell. Survives logout.

jobs – Background jobs

Lists background jobs. Shell job control.

fg – Foreground job

Brings job to foreground. Resumes execution.

bg – Resume background job

Resumes job in background. Keeps terminal free.

wait – Wait for process

Waits for process completion. Used in scripts.


H. Users, Groups & Security

useradd – Create user

Creates new user. Low-level user creation.

usermod – Modify user

Modifies user properties. Groups, shell, UID.

userdel – Delete user

Deletes user account. Optionally removes home.

groupadd – Create group

Creates a group. Used in access control.

groups – Show group memberships

Shows user groups. Permission debugging.

passwd – Change password

Changes user password. Also locks accounts.

faillog – Login failure logs

Shows login failures. Security auditing.

lastlog – Last login info

Shows last login per user. Account usage tracking.

newgrp – Switch group

Switches primary group. Without logout.

su – Switch user

Switches user identity. Requires password.


I. Scheduling, Boot & Power

crontab -l – List cron jobs

Lists cron jobs. User-specific schedules.

atq – List at jobs

Lists scheduled at jobs. One-time tasks.

atrm – Remove at job

Removes at jobs. Cancels execution.

shutdown -r – Reboot schedule

Schedules reboot. Graceful system restart.

wall – Broadcast message

Broadcasts message. All logged-in users.

write – Message user

Sends message to user. Terminal-to-terminal.

login – Login prompt

Starts login session. Used by getty.

logout – End session

Ends user session. Shell termination.

halt – Stop CPU

Stops CPU execution. Immediate shutdown.

reboot -f – Force reboot

Forces reboot. Bypasses safety checks.


J. Packaging, Builds & System

dpkg -l – List packages

Lists installed packages. Low-level package manager.

dpkg -i – Install .deb

Installs .deb files. No dependency resolution.

apt-cache policy – Package versions

Shows package versions. Repository diagnostics.

apt-key – Repository keys

Manages repository keys. Deprecated but still seen.

add-apt-repository – Add repo

Adds new repositories. Simplifies repo management.

ldd – Shared libraries

Lists shared libraries. Binary dependency check.

ldconfig – Linker cache

Updates linker cache. System library management.

uname -r – Kernel version

Shows kernel version. Critical for compatibility.

lsmod – Loaded kernel modules

Lists loaded kernel modules. Driver inspection.

modprobe – Load kernel module

Loads kernel modules. Handles dependencies.


Last updated