KEMBAR78
Linux Commands Cheatsheet | PDF | File System | Computer Network
0% found this document useful (0 votes)
18 views30 pages

Linux Commands Cheatsheet

Uploaded by

Yash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views30 pages

Linux Commands Cheatsheet

Uploaded by

Yash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Linux Commands Cheatsheet

Core Linux Commands:


❖ pwd → Shows the current working directory.
❖ ls → Lists files and directories in the current location.
❖ cd → Changes the current directory.
❖ tree → Displays directories and files in a tree-like
format.
❖ stat → Shows detailed information about a file.
❖ touch → Creates an empty file or updates file
timestamps.
❖ file → Determines the type of a file.
❖ basename → Extracts the filename from a path.
❖ dirname → Extracts the directory path from a full
path.
❖ cat → Displays the contents of a file.
❖ tac → Displays a file’s contents in reverse order.
❖ less → Views a file one page at a time (scrollable).
❖ more → Views a file one page at a time (simpler than
less).
❖ head → Shows the first few lines of a file.
❖ tail → Shows the last few lines of a file.
❖ nl → Displays a file with line numbers.
❖ strings → Extracts readable text from binary files.
❖ od → Displays files in octal or other formats.
❖ nano → Simple text editor in terminal.
❖ vi / vim → Advanced terminal text editor.
❖ emacs → Feature-rich terminal/GUI text editor.
❖ hexdump / hd → Displays file contents in
hexadecimal format.
❖ xxd → Creates a hex dump or converts hex back to
binary.
❖ col / colrm → Formats or removes specific columns
from text.
❖ clear → Clears the terminal screen.
❖ reset → Resets the terminal.
❖ sleep → Pauses execution for a specified time.
❖ yes → Repeatedly outputs a string (default “y”) until
stopped.
❖ rev → Reverses the content of each line.
❖ cmp → Compares two files byte by byte.
❖ comm → Compares two sorted files line by line.
Searching & Text Processing Commands:
❖ grep → Searches for patterns in files.
❖ egrep → Extended grep; supports regex patterns.
❖ fgrep → Searches for fixed strings (no regex).
❖ zgrep → Searches compressed files (.gz) using grep.
❖ find → Searches files and directories by name, type,
size, etc.
❖ locate → Quickly finds files using a prebuilt database.
❖ updatedb → Updates the database used by locate.
❖ which → Shows the path of an executable command.
❖ whereis → Shows binary, source, and man page
locations of a command.
❖ type → Displays command type (builtin, alias, or file).
❖ cut → Extracts sections/columns from text.
❖ sort → Sorts lines of text alphabetically or
numerically.
❖ uniq → Removes duplicate lines (works with sorted
input).
❖ comm → Compares two sorted files line by line.
❖ join → Joins lines of two files based on a common
field.
❖ paste → Merges lines of files side by side.
❖ wc → Counts lines, words, and characters in a file.
❖ tr → Translates or deletes characters.
❖ xargs → Builds and executes commands from input.
❖ tee → Writes output to a file and displays it
simultaneously.
❖ awk → Pattern scanning and processing language for
text files.
❖ gawk / mawk → Variants of awk with added features
or performance.
❖ sed → Stream editor for modifying text in files or
streams.
❖ diff → Shows differences between two files line by
line.
❖ sdiff → Shows side-by-side differences between files.
❖ cmp → Compares two files byte by byte.
❖ iconv → Converts text from one character encoding to
another.
❖ recode → Converts text between different encodings.
❖ pr → Formats text for printing with headers and
pagination.
❖ jq → Parses and processes JSON data.
❖ yq → Parses and processes YAML data.
❖ fold → Wraps long lines to a specified width.
❖ expand → Converts tabs to spaces.
❖ unexpand → Converts spaces to tabs.
User & Group Management Commands:
❖ useradd → Creates a new user account.
❖ adduser → Adds a new user (interactive version of
useradd).
❖ passwd → Sets or changes a user’s password.
❖ usermod → Modifies an existing user account.
❖ userdel → Deletes a user account.
❖ groupadd → Creates a new group.
❖ groupdel → Deletes a group.
❖ gpasswd → Administers / manages group
memberships.
❖ groups → Lists groups a user belongs to.
❖ id → Displays user ID (UID) and group IDs (GID).
❖ whoami → Shows the current logged-in username.
❖ who → Displays who is logged in.
❖ w → Shows logged-in users and their activity.
❖ last → Shows the login history of users.
❖ lastlog → Displays the last login of all users.
❖ faillog → Shows failed login attempts.
❖ finger → Displays information about system users.
❖ su → Switches to another user account.
❖ sudo → Executes commands as another user (usually
root).
❖ visudo → Safely edits the sudoers file.
❖ chage → Manages user password expiration info.
❖ expiry → Shows account expiration info.
❖ logname → Prints the current login name.
❖ tty → Shows the terminal associated with the session.
❖ users → Displays logged-in users in one line.
❖ write → Sends a message to another user’s terminal.
❖ wall → Sends a message to all logged-in users.
❖ mesg → Controls write permissions to your terminal.
❖ pkill -KILL -u user → Terminates all processes of a
specific user.

Permissions & Ownership Commands:


❖ chmod → Changes file or directory permissions.
❖ chown → Changes file or directory owner.
❖ chgrp → Changes group ownership of a file or
directory.
❖ umask → Sets default permission mask for new
files/directories.
❖ getfacl → Displays Access Control List (ACL) of a
file/directory.
❖ setfacl → Sets or modifies ACL for a file/directory.
❖ lsattr → Lists extended attributes of files.
❖ chattr → Changes file attributes (e.g., immutable,
append-only).
❖ getcap → Shows capabilities of a file.
❖ setcap → Sets capabilities on a file.
❖ lssec → Lists security attributes of files (SELinux
context).
❖ chsec → Changes security attributes of a file.
❖ faillock → Displays or locks failed login attempts.
❖ test → Evaluates expressions (e.g., file, string, or
numeric tests).
❖ install → Copies files and sets attributes
(permissions, owner, timestamps).
❖ stat → Displays detailed status of a file or filesystem
object.

Process & Job Management:


❖ ps aux → Shows all running processes with detailed
info.
❖ ps → Displays current processes (default: user’s own).
❖ top → Interactive real-time view of processes and
resource usage.
❖ htop → Enhanced, interactive version of top with color
and easier navigation.
❖ atop → Advanced system & process monitor with
historical logging.
❖ glances → Cross-platform system monitoring tool
with summary view.
❖ pgrep → Finds process IDs matching a pattern.
❖ pkill → Kills processes by name or other attributes.
❖ kill → Sends a signal (default TERM) to a process by
PID.
❖ killall → Kills all processes matching a name.
❖ jobs → Lists background jobs in the current shell.
❖ fg → Brings a background job to the foreground.
❖ bg → Resumes a suspended job in the background.
❖ disown → Removes a job from the shell’s job table.
❖ nohup → Runs a command immune to hangups,
keeping it alive after logout.
❖ setsid → Starts a process in a new session (detached
from terminal).
❖ nice → Starts a process with a specified priority.
❖ renice → Changes the priority of a running process.
❖ uptime → Shows system load and uptime.
❖ watch → Repeatedly runs a command at intervals and
shows output.
❖ time → Measures the execution time of a command.
❖ timeout → Runs a command with a time limit.
❖ mpstat → Displays CPU usage per processor.
❖ pidstat → Shows statistics of processes including
CPU/memory usage.
❖ pstree → Displays processes in a tree structure
showing parent-child relation.
❖ lsof → Lists open files and the processes using them.
❖ vmstat → Shows virtual memory, CPU, and system
stats.
❖ pidof → Returns the PID(s) of a given process name.

System Monitoring & Performance:


❖ vmstat → Shows virtual memory, CPU, and system
performance statistics.
❖ iostat → Displays CPU and I/O statistics for devices
and partitions.
❖ dstat → Real-time system resource statistics
including CPU, disk, network, and more.
❖ sar → Collects, reports, and saves system activity
metrics over time.
❖ iotop → Shows real-time I/O usage per process.
❖ iftop → Monitors real-time network bandwidth usage
per connection.
❖ nethogs → Displays real-time network usage per
process.
❖ lsof → Lists open files and the processes using them.
❖ strace → Traces system calls and signals made by a
process.
❖ perf → Performance analysis tool for CPU profiling
and performance events.
❖ glances → Cross-platform system monitoring tool
with CPU, memory, disk, network summary.
❖ uptime → Shows how long the system has been
running with load averages.
❖ free -h → Displays total, used, and free memory in a
human-readable format.

Disk & Filesystem:


❖ lsblk → Lists information about all block devices in a
tree format.
❖ blkid → Shows block device attributes like UUID and
filesystem type.
❖ fdisk → Interactive tool to create, delete, or modify
disk partitions (MBR).
❖ parted → Advanced partitioning tool (supports GPT
and MBR).
❖ cfdisk → Curses-based interactive partition editor.
❖ sfdisk → Scriptable partitioning tool.
❖ mkfs → Creates a filesystem on a partition or disk.
❖ fsck → Checks and repairs a filesystem.
❖ tune2fs → Adjusts/ext2/ext3/ext4 filesystem
parameters.
❖ resize2fs → Resizes an ext2/ext3/ext4 filesystem.
❖ mount → Mounts a filesystem to a directory.
❖ umount → Unmounts a mounted filesystem.
❖ df → Shows disk space usage of mounted filesystems.
❖ du → Displays disk usage of files and directories.
❖ findmnt → Finds mounted filesystems or searches by
criteria.
❖ quota → Displays disk usage and limits for users.
❖ edquota → Edit disk quotas for users.
❖ repquota → Reports disk quotas for a filesystem.
❖ swapon → Enables swap space.
❖ swapoff → Disables swap space.
❖ mkswap → Prepares a partition or file as swap space.
❖ wipefs → Wipes filesystem signatures from a device.
❖ partprobe → Updates kernel with new partition table
info.
❖ losetup → Manages loop devices (mounts disk
images).
❖ cryptsetup → Sets up encrypted block devices
(LUKS).
❖ du -sh → Shows total disk usage of a file/directory in
human-readable format.
❖ df -h → Shows disk space usage in human-readable
format.
❖ stat → Displays detailed information about a file or
filesystem.
❖ file → Determines file type.
❖ mount | column -t → Lists mounted filesystems in a
clean, column-aligned format.

Compression & Archiving:


❖ tar → Archives files and directories into a single file
(optionally compresses).
❖ tar --exclude → Creates a tar archive while excluding
specified files or directories.
❖ gzip → Compresses files using the gzip algorithm.
❖ gunzip → Decompresses .gz files.
❖ bzip2 → Compresses files using the bzip2 algorithm
(better compression than gzip).
❖ bunzip2 → Decompresses .bz2 files.
❖ xz → Compresses files using the xz algorithm (high
compression ratio).
❖ unxz → Decompresses .xz files.
❖ zip → Compresses files into a .zip archive.
❖ unzip → Extracts files from a .zip archive.
❖ 7z → Compresses files using 7-Zip format.
❖ rar → Compresses files using RAR format.
❖ unrar → Extracts files from a RAR archive.
❖ split → Splits a large file into smaller chunks.
❖ csplit → Splits a file into sections based on patterns.
❖ dd → Low-level copying/conversion of files or
partitions.
❖ rsnapshot → Incremental filesystem backup utility
using rsync.
❖ borg → Deduplicating backup tool for efficient
storage.
❖ restic → Secure, fast, and efficient backup program.
❖ compress → Compresses files using the older Unix
compress algorithm.
❖ uncompress → Decompresses files created with
compress.

Networking & Remote Access:


❖ ip → Shows/manages network interfaces, routing, and
addresses.
❖ ip a → Displays all network interfaces and their IP
addresses.
❖ ifconfig → Displays or configures network interfaces
(legacy).
❖ ethtool → Displays and modifies Ethernet device
settings.
❖ iwconfig → Displays or configures wireless network
interfaces.
❖ ping → Checks connectivity to a host and measures
response time.
❖ traceroute → Shows the path packets take to reach a
host.
❖ mtr → Combines ping and traceroute for real-time
route analysis.
❖ curl → Transfers data to/from a server using various
protocols.
❖ wget → Downloads files from the web via HTTP,
HTTPS, FTP.
❖ scp → Securely copies files between hosts over SSH.
❖ rsync → Efficiently synchronizes files and directories
locally or remotely.
❖ ssh → Securely logs into a remote machine over SSH.
❖ sftp → Securely transfers files over SSH.
❖ ftp → Transfers files using the FTP protocol.
❖ telnet → Connects to remote hosts using Telnet
protocol (insecure).
❖ nc / netcat → Reads/writes data over network
connections (TCP/UDP).
❖ dig → Queries DNS servers for domain info.
❖ nslookup → Queries DNS servers for domain info
(legacy).
❖ host → Resolves domain names to IP addresses.
❖ arp → Displays or manipulates ARP table (IP-to-MAC
mapping).
❖ route → Displays/manages the IP routing table.
❖ ss → Shows socket statistics and network
connections.
❖ netstat → Displays network connections, routing
tables, and interface stats.
❖ tcpdump → Captures and analyzes network packets.
❖ tshark → Command-line version of Wireshark for
packet analysis.
❖ nmap → Network scanning and port discovery tool.
❖ arping → Sends ARP requests to a host to check link-
layer connectivity.
❖ iwlist → Displays detailed wireless network info.
❖ bridge → Shows/manages network bridge devices.
❖ brctl → Configures Ethernet bridge devices.
❖ vconfig → Manages VLANs on Linux (legacy).
❖ ip netns → Manages network namespaces for isolated
network environments.
❖ socat → Creates bidirectional data streams between
two endpoints.
❖ bmon → Monitors bandwidth usage per interface.
❖ ping6 → Sends ICMPv6 echo requests to check IPv6
connectivity.
❖ traceroute6 → Traces IPv6 route to a host.
❖ netcat → Alias for nc; general TCP/UDP
communication tool.
❖ netstat -tulpn → Shows listening ports and
associated processes.
❖ ss -tulpn → Displays detailed socket info for listening
ports (replacement for netstat).

Package Management:
❖ apt → High-level package manager for Debian/Ubuntu
systems (install, remove, update).
❖ apt-get → Lower-level package manager for
Debian/Ubuntu systems (script-friendly).
❖ apt-cache → Searches and queries package
information in Debian/Ubuntu.
❖ dpkg → Installs, removes, or queries individual .deb
packages.
❖ snap → Manages snap packages (universal Linux
packages).
❖ yum → Package manager for older RHEL/CentOS
systems.
❖ dnf → Modern package manager for
Fedora/RHEL/CentOS systems (replacement for
yum).
❖ rpm → Installs, queries, or removes .rpm packages.
❖ zypper → Package manager for openSUSE systems.
❖ flatpak → Manages sandboxed Linux applications.
❖ yumdownloader → Downloads RPM packages
without installing them.
❖ lsb_release -a → Shows Linux distribution info and
version details.

Services & Systemd:


❖ systemctl → Controls and manages systemd services
and the system state.
❖ service → Starts, stops, or checks status of SysV or
systemd services (legacy).
❖ chkconfig → Manages service runlevels and auto-
start (SysV legacy).
❖ journalctl → Views logs collected by systemd’s
journal.
❖ logger → Adds custom messages to the system log.
❖ systemctl isolate → Switches the system to a
specific target (runlevel).
❖ systemctl list-units → Lists loaded units (services,
sockets, mounts, etc.).
❖ systemctl status → Shows status and logs of a
specific service.
❖ systemctl start → Starts a service immediately.
❖ systemctl stop → Stops a running service.
❖ systemctl enable → Configures a service to start
automatically on boot.
❖ systemctl disable → Prevents a service from starting
on boot.
❖ systemctl rescue → Switches system to rescue mode
(single-user).
❖ systemctl reboot --firmware-setup → Reboots into
firmware/BIOS setup.
❖ systemctl default → Switches system to the default
target (normal boot).

Scheduling:
❖ cron → Daemon that runs scheduled tasks
automatically at specified times.
❖ crontab → Edits or lists a user’s scheduled cron jobs.
❖ at → Schedules a one-time task to run at a specific
time.
❖ batch → Schedules a task to run when system load is
low.
❖ anacron → Runs periodic jobs on systems that are not
always powered on.
❖ systemd-run → Schedules a command to run as a
transient systemd service.
❖ timers → systemd units that schedule tasks like cron
jobs.
❖ watch → Repeatedly executes a command at intervals
and displays output.

Shell & Environment:


❖ echo → Prints text or variables to the terminal.
❖ printf → Formats and prints text with more control
than echo.
❖ read → Reads input from the user into a variable.
❖ history → Shows previously executed commands.
❖ alias → Creates a shortcut for a command.
❖ unalias → Removes an existing alias.
❖ export → Sets environment variables for child
processes.
❖ env → Displays or runs commands with modified
environment variables.
❖ set → Shows or sets shell options and variables.
❖ unset → Removes a shell variable or function.
❖ .bashrc → Shell startup file executed for interactive
non-login shells.
❖ .profile → Shell startup file executed for login shells.
❖ PATH → Environment variable listing directories
searched for executables.
❖ which → Shows the full path of a command.
❖ type → Describes how a command will be interpreted
(builtin, alias, file).
❖ hash → Caches the locations of commands to speed
up execution.
❖ basename → Extracts the filename from a path.
❖ dirname → Extracts the directory path from a full
path.
❖ command → Executes a command bypassing shell
functions or aliases.
❖ eval → Evaluates and executes arguments as a shell
command.
❖ exec → Replaces the current shell with a specified
command.
❖ sleep → Pauses execution for a specified amount of
time.

Security & Access Control:


❖ getenforce → Shows the current SELinux mode
(Enforcing, Permissive, Disabled).
❖ setenforce → Changes the SELinux mode temporarily.
❖ sestatus → Displays detailed SELinux status.
❖ semanage → Manages SELinux policy components
(ports, users, file contexts).
❖ apparmor_status / aa-status → Shows the status of
AppArmor profiles.
❖ ufw → Simplified firewall management tool (Ubuntu).
❖ firewall-cmd → Manages firewalld (RHEL/Fedora)
rules and zones.
❖ iptables → Configures IPv4 packet filtering rules.
❖ nft → Manages modern packet filtering (nftables).
❖ tripwire → Monitors file integrity for security
violations.
❖ aide → Advanced Intrusion Detection Environment;
checks file integrity.
❖ getcap → Shows capabilities set on files.
❖ setcap → Sets file capabilities (e.g., allow root
privileges on binaries).
❖ lssec → Displays security attributes of files (SELinux).
❖ chsec → Changes security attributes of files
(SELinux).
❖ faillock → Tracks failed login attempts and locks
accounts.
❖ gpg / gpg2 → Encrypts, decrypts, and signs files using
GPG/PGP.
❖ openssl → Toolkit for SSL/TLS, encryption, and
certificate management.
❖ sha256sum → Computes SHA-256 checksum for file
integrity verification.
❖ md5sum → Computes MD5 checksum for file integrity
verification.
❖ shasum → Computes SHA checksums (multiple
algorithms supported).
❖ chroot → Changes root directory for a process,
isolating its filesystem.

Logging & Auditing:


❖ journalctl → Views logs collected by systemd’s
journal.
❖ logrotate → Rotates, compresses, and manages log
files automatically.
❖ /var/log/syslog → System log file for general
messages (Debian/Ubuntu).
❖ /var/log/messages → System log file for general
messages (RHEL/CentOS).
❖ dmesg → Shows kernel ring buffer messages (boot
and hardware logs).
❖ dmesg -T → Displays kernel messages with human-
readable timestamps.
❖ auditctl → Configures the Linux audit system.
❖ ausearch → Searches audit logs for specific events.
❖ aureport → Generates summary reports from audit
logs.
❖ logger → Adds custom messages to system logs.
❖ last → Shows login history of users.
❖ lastb → Shows failed login attempts.
❖ journalctl -xe → Displays systemd logs with priority
and extended info (useful for debugging).

System Information & OS Details:


❖ uname -a → Displays all system information (kernel,
hostname, architecture, OS).
❖ uname -r → Shows the kernel release version.
❖ uname -m → Shows the system architecture (e.g.,
x86_64).
❖ arch → Displays the machine architecture.
❖ dpkg --print-architecture → Shows Debian/Ubuntu
system architecture.
❖ cat /etc/os-release → Displays OS name and version
info.
❖ lsb_release -a → Shows detailed Linux distribution
info.
❖ hostname → Displays the current system hostname.
❖ hostnamectl → Shows and manages system
hostname and related settings.
❖ lscpu → Displays detailed CPU architecture info.
❖ lsusb → Lists USB devices connected to the system.
❖ lspci → Lists PCI devices (graphics, network, etc.).
❖ lshw → Shows detailed hardware configuration.
❖ dmidecode → Dumps BIOS/firmware and hardware
info.
❖ hwclock → Displays or sets the hardware clock.
❖ timedatectl → Shows or sets system time, date, and
timezone.
❖ uptime -p → Shows system uptime in a human-
readable format.
❖ free -m → Displays memory usage in MB.
❖ free -g → Displays memory usage in GB.
❖ inxi → Shows comprehensive system hardware and
OS info.
❖ lsns → Lists all namespaces in the system.
❖ numactl → Displays NUMA node info and allows
process placement.
❖ taskset → Sets or displays CPU affinity for a process.
❖ dmesg → Shows kernel messages (boot, hardware,
driver info).
❖ blkid → Shows block devices with UUID and
filesystem type.
Power & Boot Management:
❖ shutdown → Schedules or immediately shuts down or
reboots the system.
❖ reboot → Restarts the system immediately.
❖ halt → Stops all CPU functions and brings the system
to a halt.
❖ poweroff → Powers off the system completely.
❖ init → Changes the system runlevel or initializes the
system (SysV).
❖ runlevel → Shows the current and previous runlevels.
❖ telinit → Changes the system runlevel (legacy).
❖ grub2-install → Installs GRUB2 bootloader on a disk.
❖ update-grub → Generates a new GRUB configuration
file.
❖ fsck -y /dev/sdX → Checks and automatically repairs
a filesystem.
❖ chroot → Changes root directory for recovery or
isolated environment.
❖ rescue mode → Boot mode for repairing system or
recovering from failures.
File Transfer & Sharing:
❖ scp -r → Recursively copies directories/files securely
over SSH.
❖ rsync -avz → Synchronizes files/directories with
archive mode, verbose output, and compression.
❖ curl -O → Downloads a file from a URL and saves it
with its original name.
❖ wget -c → Continues downloading a partially
downloaded file.
❖ nc -l -p 1234 > file + nc host 1234 < file → Transfers a
file over TCP using netcat (listener + sender).
❖ python3 -m http.server 8080 → Starts a simple HTTP
server on port 8080.
❖ nfs-utils → Provides utilities for mounting and
managing NFS shares.
❖ samba → Provides SMB/CIFS file sharing services on
Linux.
❖ smbclient → Connects to and interacts with
SMB/CIFS shares.
❖ mount.cifs → Mounts SMB/CIFS network shares on
Linux.
Virtualization & Containers:
❖ virsh → Manages and controls KVM/QEMU virtual
machines.
❖ virt-install → Creates and installs new virtual
machines on KVM/QEMU.
❖ qemu-img → Creates, converts, and manipulates disk
images for QEMU.
❖ docker → Manages Docker containers, images, and
networks.
❖ podman → Manages containers and images without
requiring a daemon (Docker alternative).
❖ ctr → CLI client for containerd to manage containers
and images.
❖ crictl → CLI for interacting with CRI-compatible
container runtimes (Kubernetes).
❖ lxc → Manages Linux containers (low-level).
❖ lxd → Provides a daemon and tools for managing LXC
containers (higher-level).

Developer Tools:
❖ gcc → GNU C/C++ compiler for compiling source
code into binaries.
❖ make → Automates building projects based on
Makefile rules.
❖ cmake → Cross-platform build system generator for
complex projects.
❖ ldd → Shows shared library dependencies of a binary.
❖ strace → Traces system calls and signals used by a
program.
❖ ltrace → Traces library calls made by a program.
❖ gdb → GNU debugger for debugging programs at
runtime.
❖ perf → Performance analysis tool for CPU profiling
and performance events.
❖ git → Distributed version control system for source
code management.
❖ svn → Centralized version control system
(Subversion).
❖ patch → Applies changes to files using diff output.

Troubleshooting & Recovery:


❖ journalctl -xe → Displays systemd logs with priority
and extended info for troubleshooting.
❖ systemctl rescue → Switches the system to rescue
mode (single-user, minimal services).
❖ grub2-install → Installs GRUB2 bootloader on a disk.
❖ update-grub → Regenerates GRUB configuration file.
❖ chroot → Changes root directory for recovery or
isolated environment.
❖ fsck -y /dev/sdX → Checks and automatically repairs
a filesystem on the specified device.
❖ rescue mode → Boot mode for repairing system
issues or recovering from failures.

Fun / Miscellaneous Linux commands:


❖ cowsay → Displays a message as spoken by an ASCII
cow (or other characters).
❖ fortune → Displays a random witty or inspirational
quote.
❖ sl → Steam Locomotive animation, a fun joke when ls
is mistyped.
❖ yes → Repeatedly outputs a string (default: “y”) until
stopped.
❖ rev → Reverses lines of text.
❖ cal → Displays a simple calendar for the current
month or specified month/year.
❖ ncal → Displays an alternate calendar format with
week numbers.
❖ date → Shows or sets the system date and time.
❖ timedatectl → Displays or changes system time, date,
and timezone.
❖ figlet → Creates large ASCII text banners from input.
❖ toilet → Creates colorful ASCII text banners with
effects.
Practice Recommendation
• Cloud: Launch a free-tier Linux VM (AWS, Oracle,
Azure, GCP) and practice commands.
• Local VM: Use Oracle VirtualBox or VMware to run
Ubuntu/CentOS/Debian safely.
• Tips: Start with basic commands (files, processes),
then try networking, monitoring, and system
management.
• Explore: Use man <command> or <command> --help
and try combining commands (e.g., ps aux | grep
<process>).
Practicing on a VM or cloud instance helps you learn
Linux and prepares you for DevOps/Cloud tasks.

You might also like