Showing 110 of 110 commands

File System & Navigation

Navigate directories, inspect paths, and analyze filesystem usage quickly

13 commands
pwdbeginner

Print the full path of your current working directory.

ls -lahbeginner

List files with permissions, owners, sizes, and hidden entries in a readable format.

cd /var/logbeginner

Change into another directory by absolute or relative path.

find . -type f -name "*.log"intermediate

Search recursively for files matching a name pattern.

find . -type f -mtime -1intermediate

Locate files modified within the last day.

locate sshd_configbeginner

Query the locate database for files by name almost instantly.

tree -L 2beginner

Display directory contents as a tree up to a chosen depth.

du -sh .beginner

Show the total size of the current directory in human-readable form.

du -sh * | sort -hintermediate

Rank files and folders by size to find what is consuming space.

df -hbeginner

Show mounted filesystem capacity, usage, and free space.

realpath ./script.shbeginner

Resolve a relative path into its canonical absolute path.

stat /etc/passwdintermediate

Inspect detailed file metadata like size, inode, mode, and timestamps.

basename /var/log/nginx/access.logbeginner

Extract the filename portion from a full path.

File Operations

Copy, move, remove, link, and permission files safely from the terminal

13 commands
cp -av src/ backup/beginner

Copy files or directories while preserving attributes and showing progress.

cp -r templates/ releases/templates/beginner

Recursively copy a directory and everything inside it.

mv old-name.txt new-name.txtbeginner

Rename a file or move it to another directory.

rm -rf build/intermediate

Force-remove files or directories recursively.

mkdir -p logs/archive/2024/07beginner

Create nested directories without failing if parents already exist.

touch deploy.logbeginner

Create an empty file or update its modification timestamp.

touch -d "2024-01-01 00:00" audit.logintermediate

Set a file timestamp manually for testing or restore workflows.

ln -s /opt/app/current /srv/www/appintermediate

Create a symbolic link that points to another file or directory.

ln existing.txt hardlink.txtadvanced

Create a hard link that references the same inode as the original file.

chmod 644 app.confbeginner

Set read-write for owner and read-only for group and others.

chmod u+x deploy.shbeginner

Add execute permission for the file owner using symbolic mode.

chmod -R 750 scripts/intermediate

Recursively apply restrictive directory and file permissions.

chown -R deploy:devops /srv/appintermediate

Change file ownership recursively to a user and group.

Text Processing

Inspect, search, transform, and compare text directly from the command line

14 commands
cat /etc/os-releasebeginner

Print a file to standard output exactly as stored.

grep -n "ERROR" app.logbeginner

Search for matching text and show the line numbers for each hit.

grep -Rin "DATABASE_URL" .intermediate

Search recursively through a project for a string or pattern.

awk -F: '{print $1, $7}' /etc/passwdadvanced

Split input into fields and print selected columns or computed values.

sed -n '1,20p' file.txtintermediate

Print only a selected range of lines from a file.

sed 's/http:/https:/g' urls.txtintermediate

Replace matching text in a stream using sed substitution syntax.

cut -d: -f1 /etc/passwdbeginner

Extract specific delimiter-separated fields from each input line.

sort -u hosts.txtbeginner

Sort lines alphabetically and remove duplicates in one step.

uniq -c access.logintermediate

Collapse adjacent duplicate lines and count their occurrences.

wc -l app.logbeginner

Count lines, words, or bytes in a file or stream.

head -n 20 server.logbeginner

Show the first lines of a file for quick inspection.

tail -f /var/log/nginx/access.logbeginner

Follow the end of a growing log file in real time.

diff -u old.conf new.confintermediate

Compare two files and show unified diff output.

less +G /var/log/syslogbeginner

Open a file in a pager for efficient scrolling, searching, and navigation.

Process Management

Monitor processes, adjust priorities, manage jobs, and inspect system services

15 commands
ps auxbeginner

List every running process with CPU, memory, user, and command details.

pgrep -af nodeintermediate

Find process IDs and commands by pattern without scanning raw ps output manually.

topbeginner

Open the built-in live process monitor for CPU and memory analysis.

htopbeginner

Use an interactive, colorized process viewer with easier sorting and filtering.

kill -15 1234intermediate

Send SIGTERM so a process can shut down gracefully.

kill -9 1234intermediate

Force-kill a stuck process using SIGKILL when graceful shutdown fails.

killall nginxintermediate

Signal all processes with the same name at once.

nice -n 10 tar -czf backup.tar.gz /srv/dataadvanced

Start a process with lower CPU scheduling priority.

nohup npm run start > app.log 2>&1 &intermediate

Run a command immune to hangups so it keeps running after logout.

jobsbeginner

List background and stopped jobs in the current shell session.

bg %1intermediate

Resume a stopped shell job and continue it in the background.

fg %1intermediate

Bring a background or stopped job back into the foreground.

systemctl status nginxbeginner

Check the current state, logs, and unit details for a systemd service.

systemctl restart nginxbeginner

Restart a service managed by systemd.

journalctl -u nginx -fintermediate

Follow logs from a specific systemd service in real time.

Networking

Inspect interfaces, test connectivity, transfer files, and troubleshoot ports

13 commands
ip addr showbeginner

Display IP addresses and status for all network interfaces.

ip route showintermediate

Inspect the kernel routing table and default gateway configuration.

ifconfig -abeginner

Show interface configuration using the legacy net-tools command set.

ping -c 4 8.8.8.8beginner

Test reachability and round-trip latency to a host.

curl -I https://example.combeginner

Fetch HTTP headers to verify status codes, redirects, and server metadata.

wget -O backup.html https://example.combeginner

Download a remote resource and save it to a chosen filename.

ss -tulpnintermediate

List listening TCP and UDP sockets with associated processes.

netstat -tulpnintermediate

Display active listening ports and bound services with the classic networking tool.

nmap -sV 192.168.1.10advanced

Scan a target host for open ports and detected service versions.

ssh devops@server.example.combeginner

Open an encrypted remote shell session over SSH.

scp app.tar.gz devops@server:/srv/releases/intermediate

Securely copy files between local and remote systems over SSH.

rsync -avz ./site/ devops@server:/var/www/site/intermediate

Synchronize files efficiently while transferring only deltas.

nc -vz localhost 5432intermediate

Test whether a TCP port is reachable using netcat.

User & Permissions

Manage accounts, groups, identity, privilege escalation, and permission models

13 commands
whoamibeginner

Print the effective username of the current shell session.

idbeginner

Show the current user ID, group ID, and supplementary groups.

sudo -lintermediate

List the commands the current user may run with sudo.

su - deployintermediate

Switch to another user account with a full login shell.

passwdbeginner

Change the password for the current account.

useradd -m -s /bin/bash aliceintermediate

Create a new user with a home directory and default Bash shell.

usermod -aG docker aliceintermediate

Append a user to an additional supplementary group.

userdel -r aliceintermediate

Delete a user account and remove its home directory.

groupadd devopsintermediate

Create a new system group for shared access control.

groups alicebeginner

List all groups that a user belongs to.

chmod 755 deploy.shbeginner

Set owner read-write-execute and read-execute for group and others using octal mode.

chmod 640 /etc/myapp.envbeginner

Restrict a sensitive file to owner read-write and group read-only using octal permissions.

chown -R alice:devops /srv/appintermediate

Recursively set both owner and group for an application directory.

Disk & Storage

Inspect block devices, mount filesystems, partition disks, and archive data

14 commands
df -hTbeginner

Show disk usage with human-readable sizes and filesystem types.

du -sh /var/logbeginner

Measure how much space a directory consumes.

lsblk -fbeginner

List block devices, partitions, filesystems, and mount points.

mount | column -tintermediate

Display all currently mounted filesystems in an easy-to-scan format.

mount /dev/sdb1 /mnt/dataintermediate

Mount a filesystem at a chosen directory so it becomes accessible.

umount /mnt/dataintermediate

Unmount a filesystem cleanly before removing or reformatting it.

fdisk -ladvanced

List disk partitions and geometry using the classic partitioning utility.

parted -ladvanced

Inspect partition tables with GNU Parted, including GPT layouts.

mkfs.ext4 /dev/sdb1advanced

Create an ext4 filesystem on a partition or block device.

tar -czf backup.tar.gz /etc/nginxbeginner

Create a compressed tar archive from files or directories.

tar -xzf backup.tar.gzbeginner

Extract a gzip-compressed tar archive into the current directory.

gzip -k app.logbeginner

Compress a file with gzip while keeping the original copy.

zip -r artifacts.zip dist/beginner

Create a ZIP archive recursively from a folder or file set.

unzip artifacts.zip -d restore/beginner

Extract a ZIP archive into a target directory.

Bash Scripting

Write safer shell scripts with variables, control flow, arrays, pipes, and cron

15 commands
#!/usr/bin/env bashbeginner

Use a portable shebang so the script runs with Bash from the current environment.

set -euo pipefailintermediate

Exit on errors, treat unset variables as failures, and catch pipe errors early.

ENVIRONMENT="production"beginner

Assign a shell variable without spaces around the equals sign.

echo "${ENVIRONMENT^^}"intermediate

Expand a variable and transform it to uppercase using Bash string operations.

if [[ -f .env ]]; then echo "found"; fibeginner

Run commands conditionally when a file, string, or status test succeeds.

case "$1" in start|stop|restart) echo "ok" ;; *) exit 1 ;; esacintermediate

Dispatch different logic branches based on an input argument.

for file in *.log; do gzip "$file"; donebeginner

Loop over matching files and run the same command for each one.

while read -r host; do ping -c 1 "$host"; done < hosts.txtintermediate

Read input line by line from standard input or a file safely.

sum() { echo "$(( $1 + $2 ))"; }intermediate

Define a reusable shell function that accepts positional parameters.

servers=("web-1" "web-2" "web-3")beginner

Create a Bash array for managing multiple related values.

echo "${servers[@]}"intermediate

Expand every array element as separate words.

command > out.log 2> err.logbeginner

Redirect standard output and standard error to different files.

command >> app.log 2>&1beginner

Append both stdout and stderr to the same log file.

journalctl -u nginx | grep ERROR | tee errors.logintermediate

Pipe output through multiple commands and save a copy with tee.

(crontab -l; echo "0 2 * * * /opt/scripts/backup.sh >> /var/log/backup.log 2>&1") | crontab -advanced

Install a recurring cron job that runs a command on a fixed schedule.