Linux Tools

Linux Command Explorer

Search and explore Linux commands with examples and man page summaries.

ls

List information about files and directories in the current working directory or specified locations.

File Management
Syntax
ls [OPTION]... [FILE]...
Common Options
Option Description
-l Use a long listing format
-a Do not ignore entries starting with .
-h Print sizes in human readable format (e.g., 1K 234M 2G)
-R List subdirectories recursively
-t Sort by modification time (newest first)
-r Reverse order while sorting
Examples

List all files including hidden ones with detailed information

$ ls -la

List files in /var/log with human-readable file sizes

$ ls -lh /var/log

cd

Change the current working directory to the specified path.

File Management
Syntax
cd [DIRECTORY]
Common Options
Option Description
~ Change to home directory
.. Change to parent directory
- Change to previous directory
Examples

Change to home directory

$ cd ~

Change to parent directory

$ cd ..

pwd

Print the full pathname of the current working directory.

File Management
Syntax
pwd [OPTION]
Common Options
Option Description
-P Display physical path without symlinks
-L Display logical path with symlinks
Examples

Display current working directory

$ pwd

mkdir

Create new directory or directories.

File Management
Syntax
mkdir [OPTION]... DIRECTORY...
Common Options
Option Description
-p Create parent directories as needed
-v Print a message for each created directory
-m Set file mode/permissions
Examples

Create a directory

$ mkdir new_folder

Create nested directories

$ mkdir -p parent/child/grandchild

rmdir

Remove empty directories.

File Management
Syntax
rmdir [OPTION]... DIRECTORY...
Common Options
Option Description
-p Remove parent directories when empty
-v Print a message for each removed directory
Examples

Remove an empty directory

$ rmdir empty_folder

touch

Change file timestamps or create an empty file.

File Management
Syntax
touch [OPTION]... FILE...
Common Options
Option Description
-c Do not create any files
-a Change only the access time
-m Change only the modification time
-t Use specified timestamp
Examples

Create a new empty file

$ touch file.txt

Update modification time of existing file

$ touch file.txt

cp

Copy files and directories from source to destination.

File Management
Syntax
cp [OPTION]... SOURCE... DESTINATION
Common Options
Option Description
-r/-R Copy directories recursively
-i Prompt before overwriting
-u Copy only newer files
-p Preserve attributes (permissions, timestamps)
Examples

Copy a file

$ cp file1.txt file2.txt

Copy directory recursively

$ cp -r /source /destination

mv

Move or rename files and directories.

File Management
Syntax
mv [OPTION]... SOURCE... DESTINATION
Common Options
Option Description
-i Prompt before overwriting
-u Move only newer files
-n Do not overwrite existing files
-v Explain what is being done
Examples

Rename a file

$ mv oldname.txt newname.txt

Move file to different directory

$ mv file.txt /home/user/documents/

rm

Remove files or directories from the system.

File Management
Syntax
rm [OPTION]... FILE...
Common Options
Option Description
-r/-R Remove directories recursively
-f Force removal without prompting
-i Prompt before every removal
-v Explain what is being done
Examples

Remove a file

$ rm file.txt

Remove directory recursively (careful!)

$ rm -rf directory/

ln

Create hard or symbolic links between files.

File Management
Syntax
ln [OPTION]... TARGET LINK_NAME
Common Options
Option Description
-s Create symbolic (soft) link
-f Remove existing destination files
-n Treat destination as normal file
-v Print name of each linked file
Examples

Create symbolic link

$ ln -s /usr/bin/python3 python

Create hard link

$ ln file.txt file_hardlink.txt

cat

Read and output the content of files sequentially.

File Management
Syntax
cat [OPTION]... [FILE]...
Common Options
Option Description
-n Number output lines
-b Number non-empty output lines
-E Display $ at end of each line
-s Suppress repeated empty lines
Examples

Display file content

$ cat file.txt

Number lines while displaying

$ cat -n file.txt

tac

Display file content in reverse order (last line first).

File Management
Syntax
tac [OPTION]... [FILE]...
Common Options
Option Description
-b Separate before rather than after
-r Interpret separator as regex
-s Use specified string as separator
Examples

Display file in reverse

$ tac file.txt

nl

Number lines in files with customizable formatting.

File Management
Syntax
nl [OPTION]... [FILE]...
Common Options
Option Description
-b Number body lines style
-f Number footer lines style
-h Number header lines style
-n Number format (ln, rn, rz)
-w Number width
Examples

Add line numbers to file

$ nl file.txt

head

Display the first lines of files (default: 10 lines).

File Management
Syntax
head [OPTION]... [FILE]...
Common Options
Option Description
-n Number of lines to display
-c Number of bytes to display
-q Never print headers
-v Always print headers
Examples

Show first 20 lines of file

$ head -n 20 file.txt

tail

Display the last lines of files (default: 10 lines).

File Management
Syntax
tail [OPTION]... [FILE]...
Common Options
Option Description
-n Number of lines to display
-f Follow file growth (stream mode)
-F Follow with file rotation
-c Number of bytes to display
Examples

Show last 20 lines of file

$ tail -n 20 file.txt

Monitor log file in real-time

$ tail -f /var/log/syslog

less

View file contents with pagination and scrolling.

File Management
Syntax
less [OPTION]... [FILE]...
Common Options
Option Description
-N Show line numbers
-S Chop long lines
-g Highlight search results
-i Case-insensitive search
Examples

View file with pagination

$ less file.txt

more

View file contents page by page.

File Management
Syntax
more [OPTION]... [FILE]...
Common Options
Option Description
-d Display help prompt
-c Clear screen before display
-p Don't scroll, clean screen
-n Lines per screen
Examples

View file page by page

$ more file.txt

grep

Search files for patterns/regular expressions.

File Management
Syntax
grep [OPTION]... PATTERN [FILE]...
Common Options
Option Description
-i Ignore case distinctions
-r Recursive search
-v Invert match (exclude)
-l Show only matching files
-n Show line numbers
Examples

Search for text in file

$ grep "error" log.txt

Search recursively in all files

$ grep -r "password" /etc/

egrep

Search using extended regular expressions (equivalent to grep -E).

General
Syntax
egrep [OPTION]... PATTERN [FILE]...
Common Options
Option Description
-i Ignore case
-r Recursive
-v Invert match
-w Match whole word
Examples

Search with extended regex

$ egrep "(error|warning)" log.txt

fgrep

Search for fixed strings (equivalent to grep -F).

Text Processing
Syntax
fgrep [OPTION]... PATTERN [FILE]...
Common Options
Option Description
-i Ignore case
-r Recursive
-v Invert match
-l Show only matching files
Examples

Search for literal string

$ fgrep "error*" log.txt

sed

Text stream editor for filtering and transforming text.

Text Processing
Syntax
sed [OPTION]... {script} [input-file]...
Common Options
Option Description
-i Edit files in-place
-n Suppress automatic printing
-e Add script to commands
-f Use script file
Examples

Replace text in file

$ sed 's/old/new/g' file.txt

Delete lines containing pattern

$ sed '/pattern/d' file.txt

awk

Pattern scanning and processing language for text manipulation.

Networking
Syntax
awk [OPTION]... 'program' [file]...
Common Options
Option Description
-F Field separator
-v Assign variable
-f Use program file
Examples

Print first column

$ awk '{print $1}' file.txt

Search pattern and print

$ awk '/error/ {print $0}' log.txt

cut

Extract sections/columns from each line of file.

File Management
Syntax
cut [OPTION]... [FILE]...
Common Options
Option Description
-c Extract by character positions
-f Extract by fields
-d Field delimiter
--complement Output other fields
Examples

Extract first 5 characters

$ cut -c 1-5 file.txt

Extract second field (delimited by comma)

$ cut -d',' -f2 file.csv

paste

Merge lines from multiple files.

File Management
Syntax
paste [OPTION]... [FILE]...
Common Options
Option Description
-d Delimiter (tab by default)
-s Serial (paste one file at a time)
Examples

Merge two files side by side

$ paste file1.txt file2.txt

sort

Sort lines of text files.

File Management
Syntax
sort [OPTION]... [FILE]...
Common Options
Option Description
-n Numeric sort
-r Reverse order
-k Sort by key/field
-u Unique (remove duplicates)
-t Field delimiter
Examples

Sort file alphabetically

$ sort file.txt

Sort numerically

$ sort -n numbers.txt

uniq

Report or omit repeated lines (must be sorted).

General
Syntax
uniq [OPTION]... [INPUT [OUTPUT]]
Common Options
Option Description
-c Count occurrences
-d Only print duplicates
-i Ignore case
-u Only print unique lines
Examples

Display unique lines

$ uniq file.txt

Count duplicate occurrences

$ sort file.txt | uniq -c

wc

Print line, word, and byte/character counts.

Text Processing
Syntax
wc [OPTION]... [FILE]...
Common Options
Option Description
-l Line count
-w Word count
-c Byte count
-m Character count
-L Longest line length
Examples

Count lines in file

$ wc -l file.txt

Display all counts

$ wc file.txt

tr

Translate or delete characters from input.

General
Syntax
tr [OPTION]... SET1 [SET2]
Common Options
Option Description
-d Delete characters in SET1
-s Squeeze repeated characters
-c Complement SET1
Examples

Convert uppercase to lowercase

$ tr 'A-Z' 'a-z' < file.txt

Delete specified characters

$ tr -d 'aeiou' < file.txt

tee

Read from stdin and write to stdout and files.

File Management
Syntax
tee [OPTION]... [FILE]...
Common Options
Option Description
-a Append to files (don't overwrite)
-i Ignore interrupt signals
Examples

Write to file and display output

$ echo "Hello" | tee file.txt

Append to multiple files

$ command | tee -a log1.txt log2.txt

xargs

Build and execute commands from stdin input.

General
Syntax
xargs [OPTION]... [COMMAND] [INITIAL-ARGS]
Common Options
Option Description
-n Max arguments per command
-p Prompt before executing
-0 Items separated by null
-I Replace string
Examples

Delete all .tmp files

$ find . -name "*.tmp" | xargs rm -f

Run commands in parallel

$ echo "cmd1 cmd2" | xargs -n 1 -P 2 sh -c

split

Split file into smaller pieces.

File Management
Syntax
split [OPTION]... [INPUT] [PREFIX]
Common Options
Option Description
-b Split by bytes
-l Split by number of lines
-n Number of pieces
Examples

Split by lines

$ split -l 1000 bigfile.txt

Split by size

$ split -b 10M largefile.bin

join

Join lines of two files on common field.

File Management
Syntax
join [OPTION]... FILE1 FILE2
Common Options
Option Description
-1 Field in first file
-2 Field in second file
-t Field delimiter
-a Include unpairable lines
Examples

Join two CSV files

$ join -t',' file1.csv file2.csv

comm

Compare two sorted files line by line.

File Management
Syntax
comm [OPTION]... FILE1 FILE2
Common Options
Option Description
-1 Suppress column 1 (lines in file1)
-2 Suppress column 2 (lines in file2)
-3 Suppress column 3 (common lines)
Examples

Show only common lines

$ comm -12 file1.txt file2.txt

diff

Compare files line by line and show differences.

File Management
Syntax
diff [OPTION]... FILES
Common Options
Option Description
-u Unified format
-r Recursive for directories
-i Ignore case
-b Ignore whitespace
Examples

Compare two files

$ diff file1.txt file2.txt

Unified diff output

$ diff -u file1.txt file2.txt

cmp

Compare files byte by byte.

File Management
Syntax
cmp [OPTION]... FILE1 [FILE2]
Common Options
Option Description
-l Verbose output
-s Silent (return code only)
-i Skip initial bytes
Examples

Compare two files

$ cmp file1.bin file2.bin

strings

Extract printable strings from binary files.

File Management
Syntax
strings [OPTION]... [FILE]...
Common Options
Option Description
-n Minimum length
-a Scan entire file
-t Show offset
Examples

Extract strings from binary

$ strings /bin/ls

fmt

Format text by wrapping paragraphs.

Networking
Syntax
fmt [OPTION]... [FILE]...
Common Options
Option Description
-w Set line width
-s Split only long lines
-t Tab formatting
Examples

Format text to 80 columns

$ fmt -w 80 file.txt

fold

Wrap each input line to fit specified width.

General
Syntax
fold [OPTION]... [FILE]...
Common Options
Option Description
-w Set line width (default 80)
-s Break at spaces
Examples

Fold lines to 50 characters

$ fold -w 50 file.txt

rev

Reverse characters in each line of file.

File Management
Syntax
rev [OPTION]... [FILE]...
Examples

Reverse each line

$ rev file.txt

shuf

Randomly permute lines from input.

General
Syntax
shuf [OPTION]... [FILE]
Common Options
Option Description
-n Number of output lines
-o Output to file
-r Repeat output
Examples

Shuffle lines randomly

$ shuf file.txt

Generate random numbers

$ shuf -i 1-100 -n 5

seq

Print sequence of numbers.

Text Processing
Syntax
seq [OPTION]... LAST seq [OPTION]... FIRST LAST seq [OPTION]... FIRST INCREMENT LAST
Common Options
Option Description
-f Format string
-s Separator
-w Equal width with leading zeros
Examples

Generate sequence 1 to 10

$ seq 10

Generate with format

$ seq -f "0%g" 5

yes

Output a string repeatedly (default: 'y').

Text Processing
Syntax
yes [STRING]...
Common Options
Option Description
--version Display version
--help Display help
Examples

Automatically confirm yes

$ yes | command

Output custom string repeatedly

$ yes "Hello World"

printf

Format and print data (C-like printf).

Text Processing
Syntax
printf FORMAT [ARGUMENT]...
Common Options
Option Description
-v Assign to variable
-f Include file
Examples

Print formatted text

$ printf "Hello %s\n" "World"

Format with padding

$ printf "%10d\n" 123

echo

Display line of text/string to stdout.

Text Processing
Syntax
echo [OPTION]... [STRING]...
Common Options
Option Description
-n Do not output trailing newline
-e Enable escape sequences
-E Disable escape sequences
Examples

Print simple text

$ echo "Hello World"

Enable escape sequences

$ echo -e "Line1\nLine2"

basename

Strip directory prefix from path.

File Management
Syntax
basename [OPTION]... NAME [SUFFIX]
Common Options
Option Description
-a Support multiple arguments
-s Remove suffix
Examples

Get filename from path

$ basename /home/user/file.txt

Remove extension

$ basename file.txt .txt

dirname

Strip filename suffix from path.

File Management
Syntax
dirname [OPTION]... NAME
Common Options
Option Description
-z Separate output with null
Examples

Get directory from path

$ dirname /home/user/file.txt

realpath

Print resolved absolute path.

Text Processing
Syntax
realpath [OPTION]... FILE...
Common Options
Option Description
-s Don't expand symlinks
-m Ignore nonexistent files
-e Require files to exist
Examples

Get absolute path

$ realpath file.txt

readlink

Print value of symbolic link.

Text Processing
Syntax
readlink [OPTION]... FILE
Common Options
Option Description
-f Canonicalize by following links
-e Canonicalize with existence check
Examples

Read symbolic link

$ readlink /usr/bin/python

file

Determine file type and MIME type.

File Management
Syntax
file [OPTION]... [FILE]...
Common Options
Option Description
-b Brief output
-i MIME type output
-z Look inside compressed files
Examples

Determine file type

$ file document.pdf

Show MIME type

$ file -i image.png

stat

Display detailed file status/information.

File Management
Syntax
stat [OPTION]... FILE...
Common Options
Option Description
-c Format string
-L Follow symbolic links
-f Display filesystem info
Examples

Show file statistics

$ stat file.txt

Display only size

$ stat -c %s file.txt

find

Search for files in directory hierarchy.

File Management
Syntax
find [PATH]... [EXPRESSION]
Common Options
Option Description
-name Match filename pattern
-type Match file type (f,d,l)
-size Match file size
-mtime Match modification time
-exec Execute command on found files
Examples

Find all .txt files

$ find . -name "*.txt"

Find files larger than 10MB

$ find . -size +10M -type f

locate

Find files by name using pre-built database.

File Management
Syntax
locate [OPTION]... PATTERN...
Common Options
Option Description
-i Ignore case
-l Limit results
-r Use regex pattern
-c Count results
Examples

Find file by name

$ locate file.txt

Case-insensitive search

$ locate -i document

updatedb

Update the locate database.

General
Syntax
updatedb [OPTION]...
Common Options
Option Description
-o Output database file
-e Directories to exclude
-U Root path
Examples

Update database (as root)

$ sudo updatedb

which

Show full path of shell command.

User Management
Syntax
which [OPTION]... COMMAND...
Common Options
Option Description
-a Show all matches
-s Silent (only return code)
Examples

Find command location

$ which python

Show all matches

$ which -a python

whereis

Locate binary, source, and man pages.

General
Syntax
whereis [OPTION]... COMMAND...
Common Options
Option Description
-b Search only binaries
-m Search only man pages
-s Search only sources
Examples

Find all occurrences

$ whereis ls

Search only binary

$ whereis -b gcc

type

Display command type (alias, function, built-in, file).

File Management
Syntax
type [OPTION]... NAME...
Common Options
Option Description
-a Display all locations
-t Print type only
-p Print path of file command
Examples

Show command type

$ type ls

Show all locations

$ type -a python

whatis

Display one-line description of command.

Networking
Syntax
whatis [OPTION]... KEYWORD...
Common Options
Option Description
-r Interpret as regex
-w Wildcard matching
Examples

Get command description

$ whatis ls

apropos

Search man pages for keyword.

General
Syntax
apropos [OPTION]... KEYWORD...
Common Options
Option Description
-a Match all keywords
-e Exact match
-r Regex match
Examples

Search for print-related commands

$ apropos print

man

Display system manual pages.

System Admin
Syntax
man [OPTION]... [SECTION] COMMAND
Common Options
Option Description
-k Keyword search
-f Whatis (short description)
-a Show all matches
-w Show location of man page
Examples

View manual for ls

$ man ls

Search for commands

$ man -k grep

info

Read GNU Info documentation.

General
Syntax
info [OPTION]... [TOPIC]
Common Options
Option Description
-f Specify file
-n Go to node
-a Show all matches
Examples

View info for coreutils

$ info coreutils

help

Display help for shell built-in commands.

User Management
Syntax
help [OPTION]... [COMMAND]
Common Options
Option Description
-m Display in man format
-s Short description
Examples

Get help for cd

$ help cd

chmod

Change file/directory permissions.

File Management
Syntax
chmod [OPTION]... MODE... FILE...
Common Options
Option Description
-R Recursive
-v Verbose output
-c Changed files only
--reference Copy permissions
Examples

Make file executable

$ chmod +x script.sh

Set permissions (rw-r--r--)

$ chmod 644 file.txt

chown

Change file owner and group.

File Management
Syntax
chown [OPTION]... [OWNER][:[GROUP]] FILE...
Common Options
Option Description
-R Recursive
-v Verbose output
--from Change only if current owner/group matches
Examples

Change file owner

$ chown user file.txt

Change owner and group

$ chown user:group file.txt

chgrp

Change file group ownership.

File Management
Syntax
chgrp [OPTION]... GROUP FILE...
Common Options
Option Description
-R Recursive
-v Verbose output
--referece Copy group from reference
Examples

Change file group

$ chgrp staff file.txt

umask

Set default file creation permissions mask.

File Management
Syntax
umask [OPTION]... [MASK]
Common Options
Option Description
-p Print umask in symbolic format
-S Print umask in symbolic format
Examples

Display current umask

$ umask

Set new umask

$ umask 022

install

Copy files and set attributes (like cp but with permissions).

File Management
Syntax
install [OPTION]... SOURCE... DESTINATION
Common Options
Option Description
-d Create directories
-m Set permissions
-o Set owner
-g Set group
Examples

Install file with permissions

$ install -m 755 script.sh /usr/local/bin/

Create directory

$ install -d /custom/path

mktemp

Create temporary file or directory.

File Management
Syntax
mktemp [OPTION]... [TEMPLATE]
Common Options
Option Description
-d Create directory
-p Use specific directory
-t Use template
Examples

Create temporary file

$ mktemp

Create with prefix

$ mktemp mytemp.XXXXXX

sync

Write data to disks synchronously.

Disk Usage
Syntax
sync [OPTION]...
Common Options
Option Description
-d Sync only directory entries
-f Sync filesystem
Examples

Sync all data

$ sync

du

Display disk usage of files and directories.

File Management
Syntax
du [OPTION]... [FILE]...
Common Options
Option Description
-h Human readable sizes
-s Summarize (total only)
-a Include files
-c Total summary
-d Directory depth
Examples

Show directory size

$ du -sh /home/user

Show top 10 largest

$ du -h / | sort -rh | head -10

df

Display filesystem disk space usage.

File Management
Syntax
df [OPTION]... [FILE]...
Common Options
Option Description
-h Human readable
-T Show filesystem type
-i Show inodes
-a Include dummy filesystems
Examples

Show disk usage

$ df -h

Show specific filesystem

$ df -hT /dev/sda1

mount

Mount filesystem or view mounted filesystems.

File Management
Syntax
mount [OPTION]... DEVICE DIRECTORY
Common Options
Option Description
-t Filesystem type
-o Mount options
-a Mount all from fstab
-r Mount read-only
Examples

Mount USB drive

$ mount /dev/sdb1 /mnt/usb

Mount read-only

$ mount -o ro /dev/sda1 /mnt

umount

Unmount filesystem.

File Management
Syntax
umount [OPTION]... DEVICE|DIRECTORY
Common Options
Option Description
-l Lazy unmount
-f Force unmount
-r Remount read-only if unmount fails
Examples

Unmount device

$ umount /dev/sdb1

Unmount by directory

$ umount /mnt/usb

lsblk

Display list of block devices.

Disk Usage
Syntax
lsblk [OPTION]... [DEVICE]
Common Options
Option Description
-f Show filesystem info
-m Permissions info
-l List format
-p Full paths
Examples

List all block devices

$ lsblk

Show filesystems

$ lsblk -f

blkid

Display block device attributes and UUID.

Disk Usage
Syntax
blkid [OPTION]... [DEVICE]
Common Options
Option Description
-o Output format
-s Display specific attribute
-t Search by attribute
Examples

Show all partitions

$ blkid

Get UUID

$ blkid /dev/sda1

fdisk

Manipulate disk partition table.

Networking
Syntax
fdisk [OPTION]... DEVICE
Common Options
Option Description
-l List partitions
-u Show in sectors
-s Show partition size
Examples

List partitions

$ fdisk -l

Interactive partition editing

$ fdisk /dev/sda

cfdisk

Curses-based partition table manipulator.

Networking
Syntax
cfdisk [OPTION]... DEVICE
Common Options
Option Description
-z Start with zero partition table
-P Display partition table
Examples

Interactive partition editor

$ cfdisk /dev/sda

sfdisk

Script-oriented partition table manipulator.

Networking
Syntax
sfdisk [OPTION]... DEVICE
Common Options
Option Description
-l List partitions
-d Dump partition table
-r Read-only
Examples

List partitions

$ sfdisk -l /dev/sda

Dump to file

$ sfdisk -d /dev/sda > backup.txt

parted

Partition manipulation program.

Networking
Syntax
parted [OPTION]... DEVICE [COMMAND]
Common Options
Option Description
-s Script mode
-l List devices
-a Align option
Examples

List devices

$ parted -l

Create partition

$ parted /dev/sda mkpart primary ext4 0% 100%

partprobe

Inform OS about partition table changes.

Disk Usage
Syntax
partprobe [OPTION]... [DEVICE]
Common Options
Option Description
-s Show summary
-d Dry run
Examples

Reload partition table

$ partprobe /dev/sda

mkfs

Build a filesystem on a device.

File Management
Syntax
mkfs [OPTION]... DEVICE
Common Options
Option Description
-t Filesystem type
-V Verbose output
Examples

Create filesystem

$ mkfs -t ext4 /dev/sdb1

mkfs.ext4

Create ext4 filesystem.

File Management
Syntax
mkfs.ext4 [OPTION]... DEVICE
Common Options
Option Description
-L Volume label
-b Block size
-m Reserved blocks percentage
-O Filesystem features
Examples

Create ext4 filesystem

$ mkfs.ext4 /dev/sdb1

With label

$ mkfs.ext4 -L data /dev/sdb1

mkfs.xfs

Create XFS filesystem.

File Management
Syntax
mkfs.xfs [OPTION]... DEVICE
Common Options
Option Description
-f Force overwrite
-L Label
-d Data section options
-l Log section options
Examples

Create XFS filesystem

$ mkfs.xfs /dev/sdb1

mkfs.btrfs

Create Btrfs filesystem.

File Management
Syntax
mkfs.btrfs [OPTION]... DEVICE
Common Options
Option Description
-L Label
-d Data profile
-m Metadata profile
-f Force overwrite
Examples

Create Btrfs filesystem

$ mkfs.btrfs /dev/sdb1

fsck

Check and repair filesystem consistency.

File Management
Syntax
fsck [OPTION]... DEVICE
Common Options
Option Description
-t Filesystem type
-A Check all filesystems
-y Assume yes to all questions
-V Verbose output
Examples

Check filesystem

$ fsck /dev/sda1

Force check

$ fsck -y /dev/sda1

tune2fs

Adjust ext2/ext3/ext4 filesystem parameters.

File Management
Syntax
tune2fs [OPTION]... DEVICE
Common Options
Option Description
-l List filesystem features
-c Max mount count between checks
-i Time interval between checks
-L Set volume label
Examples

Set label

$ tune2fs -L data /dev/sda1

Check filesystem parameters

$ tune2fs -l /dev/sda1

e2fsck

Check ext2/ext3/ext4 filesystem.

File Management
Syntax
e2fsck [OPTION]... DEVICE
Common Options
Option Description
-p Automatic repair
-f Force check
-c Check for bad blocks
-n Read-only check
Examples

Check filesystem

$ e2fsck /dev/sda1

Force check with auto-repair

$ e2fsck -pf /dev/sda1

resize2fs

Resize ext2/ext3/ext4 filesystem.

File Management
Syntax
resize2fs [OPTION]... DEVICE [SIZE]
Common Options
Option Description
-p Show progress
-M Shrink to minimum size
Examples

Resize to specific size

$ resize2fs /dev/sda1 10G

Expand to all available

$ resize2fs /dev/sda1

xfs_repair

Repair XFS filesystem.

File Management
Syntax
xfs_repair [OPTION]... DEVICE
Common Options
Option Description
-n Dry run (no changes)
-d Dangerous mode
-L Force log zeroing
Examples

Check filesystem

$ xfs_repair /dev/sda1

Read-only check

$ xfs_repair -n /dev/sda1

btrfs

Btrfs filesystem management tool.

File Management
Syntax
btrfs [SUBCOMMAND] [OPTION]...
Common Options
Option Description
subvolume Manage subvolumes
filesystem Filesystem operations
balance Balance data
scrub Check data integrity
Examples

Create subvolume

$ btrfs subvolume create /mnt/data

Check filesystem

$ btrfs filesystem show

mkswap

Create swap space on device or file.

File Management
Syntax
mkswap [OPTION]... DEVICE
Common Options
Option Description
-f Force
-L Label
-U UUID
Examples

Create swap partition

$ mkswap /dev/sda2

swapon

Enable swap space on device/file.

File Management
Syntax
swapon [OPTION]... [DEVICE]
Common Options
Option Description
-a Enable all from fstab
-s Display summary
-p Set priority
Examples

Enable swap

$ swapon /dev/sda2

Show swap info

$ swapon -s

swapoff

Disable swap space.

Disk Usage
Syntax
swapoff [OPTION]... [DEVICE]
Common Options
Option Description
-a Disable all swaps
-v Verbose output
Examples

Disable swap

$ swapoff /dev/sda2

free

Display system memory usage.

System Admin
Syntax
free [OPTION]...
Common Options
Option Description
-h Human readable
-m MB units
-g GB units
-s Continuous refresh
-t Total summary
Examples

Show memory usage

$ free -h

Continuous monitoring

$ free -s 2

vmstat

Report virtual memory statistics.

System Admin
Syntax
vmstat [OPTION]... [DELAY] [COUNT]
Common Options
Option Description
-s Summary statistics
-d Disk statistics
-n No headers
-w Wide output
Examples

Show memory stats

$ vmstat

Monitor every 2 seconds

$ vmstat 2

iostat

Report CPU and I/O statistics.

System Admin
Syntax
iostat [OPTION]... [DELAY] [COUNT]
Common Options
Option Description
-c CPU stats only
-d Device stats only
-x Extended stats
-k KB/s output
Examples

Show I/O stats

$ iostat

Monitor every second

$ iostat 1

sar

Collect, report, and save system activity.

System Admin
Syntax
sar [OPTION]... [INTERVAL] [COUNT]
Common Options
Option Description
-u CPU usage
-r Memory usage
-n Network usage
-d Disk usage
Examples

Show CPU usage

$ sar -u 1 5

Show memory usage

$ sar -r

uptime

Show how long system has been running.

System Admin
Syntax
uptime [OPTION]...
Common Options
Option Description
-p Pretty format
-s Show since time
Examples

Show system uptime

$ uptime

dmesg

Display kernel ring buffer messages.

System Admin
Syntax
dmesg [OPTION]...
Common Options
Option Description
-H Human readable
-T Human timestamp
-f Facility
-l Level
-c Clear buffer
Examples

Show kernel messages

$ dmesg | tail -20

Show with timestamps

$ dmesg -T

journalctl

Query systemd journal logs.

System Admin
Syntax
journalctl [OPTION]... [MATCHES]
Common Options
Option Description
-f Follow logs
-u Unit name
-p Priority level
-S Since date/time
-e Jump to end
Examples

Show all logs

$ journalctl

Follow system logs

$ journalctl -f

Since last boot

$ journalctl -b

hostname

Show or set system hostname.

Networking
Syntax
hostname [OPTION]... [NAME]
Common Options
Option Description
-f FQDN
-s Short name
-i IP address
-A All addresses
Examples

Show hostname

$ hostname

Set hostname

$ sudo hostname newname

hostnamectl

Control system hostname in systemd.

Networking
Syntax
hostnamectl [OPTION]... [COMMAND]
Common Options
Option Description
status Show current settings
set-hostname Set hostname
set-icon-name Set icon name
set-chassis Set chassis type
Examples

Show hostname info

$ hostnamectl

Set hostname

$ sudo hostnamectl set-hostname myserver

uname

Print system information.

System Admin
Syntax
uname [OPTION]...
Common Options
Option Description
-a All information
-s Kernel name
-n Network hostname
-r Kernel release
-v Kernel version
-m Machine architecture
Examples

Show all info

$ uname -a

Show kernel version

$ uname -r

lscpu

Display CPU architecture information.

System Admin
Syntax
lscpu [OPTION]...
Common Options
Option Description
-e Extended format
-p Parsable format
-x Hex masks
Examples

Show CPU info

$ lscpu

lsusb

List USB devices.

General
Syntax
lsusb [OPTION]...
Common Options
Option Description
-v Verbose
-t Tree format
-s Specify bus/device
Examples

List USB devices

$ lsusb

Show detailed info

$ lsusb -v

lspci

List PCI devices.

General
Syntax
lspci [OPTION]...
Common Options
Option Description
-v Verbose
-nn Show numeric IDs
-k Show kernel drivers
-t Tree format
Examples

List PCI devices

$ lspci

Show detailed info

$ lspci -v

dmidecode

Read system hardware data from BIOS.

System Admin
Syntax
dmidecode [OPTION]...
Common Options
Option Description
-t Type
-s String
-q Quiet mode
Examples

Show all hardware info

$ sudo dmidecode

Show memory info

$ sudo dmidecode -t memory

inxi

Comprehensive system information tool.

System Admin
Syntax
inxi [OPTION]...
Common Options
Option Description
-F Full output
-b Brief output
-G Graphics info
-D Disk info
-N Network info
Examples

Show full system info

$ inxi -F

Show brief summary

$ inxi -b

neofetch

Display system info with OS logo/ASCII art.

System Admin
Syntax
neofetch [OPTION]...
Common Options
Option Description
--off Disable ASCII logo
--image Image path
--color_blocks Color blocks
--disable Disable components
Examples

Show system info

$ neofetch

Disable logo

$ neofetch --off

fastfetch

Fast system information display tool.

System Admin
Syntax
fastfetch [OPTION]...
Common Options
Option Description
-c Config file
-l List presets
-s Structure file
Examples

Show system info

$ fastfetch

screenfetch

Display system info with ASCII art.

System Admin
Syntax
screenfetch [OPTION]...
Common Options
Option Description
-v Verbose
-s Use screenshot mode
-n No ASCII logo
Examples

Show system info

$ screenfetch

whoami

Print effective username.

Text Processing
Syntax
whoami [OPTION]...
Examples

Show current user

$ whoami

id

Display user and group information.

User Management
Syntax
id [OPTION]... [USER]
Common Options
Option Description
-u User ID only
-g Group ID only
-G All group IDs
-n Name instead of number
Examples

Show current user info

$ id

Show info for specific user

$ id username

groups

Display group memberships.

Networking
Syntax
groups [OPTION]... [USER]
Examples

Show current user groups

$ groups

users

Display list of logged-in users.

User Management
Syntax
users [OPTION]...
Examples

Show logged-in users

$ users

who

Display who is currently logged in.

General
Syntax
who [OPTION]...
Common Options
Option Description
-a All
-b Boot time
-r Run level
-q Quick summary
Examples

Show logged in users

$ who

Show all info

$ who -a

w

Show who is logged in and their activities.

General
Syntax
w [OPTION]... [USER]
Common Options
Option Description
-h No header
-u Ignore idle time
-s Short format
Examples

Show users and activities

$ w

last

Show login/reboot history from wtmp.

User Management
Syntax
last [OPTION]... [USER]...
Common Options
Option Description
-n Number of lines
-x Show system shutdowns
-f Specific file
Examples

Show recent logins

$ last -n 10

lastb

Show failed login attempts.

User Management
Syntax
lastb [OPTION]... [USER]...
Common Options
Option Description
-n Number of lines
-f Specific file
Examples

Show failed logins

$ lastb -n 10

finger

Display user information.

User Management
Syntax
finger [OPTION]... [USER]...
Common Options
Option Description
-l Long format
-s Short format
-p No plan file
Examples

Show user info

$ finger username

passwd

Change user password.

User Management
Syntax
passwd [OPTION]... [USER]
Common Options
Option Description
-e Expire password
-d Delete password
-l Lock account
-u Unlock account
Examples

Change current user password

$ passwd

Change another user's password (root)

$ sudo passwd username

chsh

Change login shell.

User Management
Syntax
chsh [OPTION]... [USER]
Common Options
Option Description
-s Set shell
-l List valid shells
Examples

Change shell

$ chsh -s /bin/zsh

List available shells

$ chsh -l

chfn

Change user's GECOS/finger information.

User Management
Syntax
chfn [OPTION]... [USER]
Common Options
Option Description
-f Full name
-o Office
-p Office phone
-h Home phone
Examples

Change user info

$ chfn username

Set full name

$ chfn -f "John Doe" username

su

Run commands as another user.

User Management
Syntax
su [OPTION]... [USER] [ARGUMENT]...
Common Options
Option Description
- Load environment
-c Run command
-l Login shell
-s Specify shell
Examples

Switch to root

$ su -

Run command as user

$ su - username -c "command"

sudo

Execute commands as another user (typically root).

User Management
Syntax
sudo [OPTION]... COMMAND
Common Options
Option Description
-u Specify user
-i Login shell
-s Shell
-l List privileges
-k Reset timeout
Examples

Run command as root

$ sudo apt update

Run as specific user

$ sudo -u username command

visudo

Safely edit sudoers file.

File Management
Syntax
visudo [OPTION]...
Common Options
Option Description
-c Check syntax
-f Specify file
-s Strict mode
Examples

Edit sudoers file

$ sudo visudo

Check syntax

$ sudo visudo -c

login

Begin session on system.

System Admin
Syntax
login [OPTION]... [USER]
Common Options
Option Description
-p Preserve environment
-f Don't authenticate
Examples

Login as user

$ login username

logout

End login session.

User Management
Syntax
logout [OPTION]...
Examples

Logout from shell

$ logout

env

Set or view environment variables.

General
Syntax
env [OPTION]... [VARIABLE=value]... [COMMAND]
Common Options
Option Description
-i Ignore environment
-u Remove variable
-0 Null termination
Examples

Show environment

$ env

Run command with variable

$ env VAR=value command

printenv

Print environment variables.

Text Processing
Syntax
printenv [OPTION]... [VARIABLE]
Common Options
Option Description
-0 Null termination
Examples

Show all environment

$ printenv

Show specific variable

$ printenv PATH

export

Set and export environment variable.

General
Syntax
export [OPTION]... [VARIABLE[=VALUE]]
Common Options
Option Description
-n Remove export property
-p Show exported variables
Examples

Set environment variable

$ export PATH=$PATH:/new/path

unset

Remove variable or function.

File Management
Syntax
unset [OPTION]... [VARIABLE]...
Common Options
Option Description
-f Remove function
-v Remove variable
Examples

Unset environment variable

$ unset VARIABLE

alias

Create or show command aliases.

General
Syntax
alias [OPTION]... [NAME=VALUE]...
Common Options
Option Description
-p Print all aliases
-g Global alias (zsh)
Examples

Create alias

$ alias ll='ls -la'

Show all aliases

$ alias

unalias

Remove command aliases.

File Management
Syntax
unalias [OPTION]... NAME...
Common Options
Option Description
-a Remove all aliases
Examples

Remove alias

$ unalias ll

Remove all

$ unalias -a

source

Execute commands from file in current shell.

File Management
Syntax
source [OPTION]... FILE
Examples

Source configuration file

$ source ~/.bashrc

history

Display or manipulate command history.

Networking
Syntax
history [OPTION]...
Common Options
Option Description
-c Clear history
-d Delete entry
-w Write to file
-r Read from file
Examples

Show history

$ history

Clear history

$ history -c

clear

Clear terminal screen.

General
Syntax
clear [OPTION]...
Examples

Clear terminal

$ clear

reset

Reset terminal settings.

General
Syntax
reset [OPTION]...
Examples

Reset terminal

$ reset

date

Display or set system date/time.

System Admin
Syntax
date [OPTION]... [+FORMAT]
Common Options
Option Description
-d Display time described by string
-s Set time
-u UTC
-R RFC 2822 format
Examples

Show current date

$ date

Show in specific format

$ date "+%Y-%m-%d %H:%M:%S"

cal

Display calendar.

General
Syntax
cal [OPTION]... [MONTH] [YEAR]
Common Options
Option Description
-3 Show previous/current/next
-y Full year
-m Monday first
-j Julian dates
Examples

Show current month

$ cal

Show specific year

$ cal 2025

timedatectl

Control system time/date in systemd.

System Admin
Syntax
timedatectl [OPTION]... [COMMAND]
Common Options
Option Description
status Show current settings
set-time Set time
set-timezone Set timezone
set-ntp Enable/disable NTP
Examples

Show current settings

$ timedatectl

Set timezone

$ sudo timedatectl set-timezone UTC

sleep

Delay for specified time.

General
Syntax
sleep [OPTION]... NUMBER[SUFFIX]...
Common Options
Option Description
--help Display help
--version Version info
Examples

Sleep for 5 seconds

$ sleep 5

Sleep for 1 minute

$ sleep 1m

watch

Execute command periodically.

General
Syntax
watch [OPTION]... COMMAND
Common Options
Option Description
-n Interval in seconds
-d Highlight changes
-t No header
-e Exit on error
Examples

Watch command every 2 seconds

$ watch -n 2 date

Watch with changes highlighted

$ watch -d ls

time

Time command execution.

General
Syntax
time [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
-o Write to file
-f Format string
Examples

Time a command

$ time ls

timeout

Run command with time limit.

General
Syntax
timeout [OPTION]... DURATION COMMAND
Common Options
Option Description
-s Signal to send
-k Kill after duration
Examples

Run command for 5 seconds

$ timeout 5s ping google.com

nice

Run command with modified niceness.

General
Syntax
nice [OPTION]... [COMMAND] [ARGUMENT]...
Common Options
Option Description
-n Niceness level (-20 to 19)
Examples

Run with low priority

$ nice -n 10 command

renice

Change priority of running process.

System Admin
Syntax
renice [OPTION]... PRIORITY [PID]...
Common Options
Option Description
-n Priority level
-g Group
-u User
Examples

Change process priority

$ renice -n 10 -p 1234

nohup

Run command immune to hangup signal.

General
Syntax
nohup [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
-p Process ID
-v Verbose output
Examples

Run command in background

$ nohup command &

jobs

Display background jobs in current session.

General
Syntax
jobs [OPTION]...
Common Options
Option Description
-l Include PID
-p PIDs only
-r Running jobs only
-s Stopped jobs only
Examples

Show background jobs

$ jobs

bg

Resume job in background.

General
Syntax
bg [OPTION]... [JOBSPEC]
Examples

Resume job in background

$ bg %1

fg

Bring job to foreground.

General
Syntax
fg [OPTION]... [JOBSPEC]
Examples

Bring job to foreground

$ fg %1

kill

Send signals to processes.

System Admin
Syntax
kill [OPTION]... PID...
Common Options
Option Description
-l List signals
-9 SIGKILL (force)
-15 SIGTERM (graceful)
Examples

Terminate process

$ kill 1234

Force terminate

$ kill -9 1234

killall

Kill processes by name.

System Admin
Syntax
killall [OPTION]... NAME...
Common Options
Option Description
-9 SIGKILL
-u Kill user's processes
-r Regex pattern
-i Interactive prompt
Examples

Kill process by name

$ killall firefox

pkill

Kill process by pattern.

System Admin
Syntax
pkill [OPTION]... PATTERN
Common Options
Option Description
-f Match full command line
-u User
-t Terminal
-x Exact match
Examples

Kill process by pattern

$ pkill firefox

pgrep

Find process by pattern.

System Admin
Syntax
pgrep [OPTION]... PATTERN
Common Options
Option Description
-l Show process names
-u User
-f Match full command line
-x Exact match
Examples

Find process ID

$ pgrep firefox

ps

Display active processes.

System Admin
Syntax
ps [OPTION]...
Common Options
Option Description
-e All processes
-f Full format
-u User format
-aux All processes with user
Examples

Show all processes

$ ps aux

Show specific user

$ ps -u username

pstree

Display process tree.

System Admin
Syntax
pstree [OPTION]... [PID|USER]
Common Options
Option Description
-p Show PIDs
-u Show user names
-a Show command lines
-h Highlight current
Examples

Show process tree

$ pstree

Show with PIDs

$ pstree -p

top

Display dynamic real-time process view.

System Admin
Syntax
top [OPTION]...
Common Options
Option Description
-u Show specific user
-p Show specific PIDs
-d Refresh interval
Examples

Show processes in real-time

$ top

htop

Interactive process viewer (enhanced top).

System Admin
Syntax
htop [OPTION]...
Common Options
Option Description
-u Show specific user
-p Show specific PIDs
-t Tree view
Examples

Launch htop

$ htop

btop

Modern, resource monitoring tool with graphs.

General
Syntax
btop [OPTION]...
Common Options
Option Description
-t Theme
-c Config file
Examples

Launch btop

$ btop

atop

Advanced system and process monitor.

System Admin
Syntax
atop [OPTION]...
Common Options
Option Description
-a Show all processes
-c Show command line
-r Read from log file
Examples

Launch atop

$ atop

glances

Cross-platform system monitoring tool.

System Admin
Syntax
glances [OPTION]...
Common Options
Option Description
-s Server mode
-c Client mode
-w Web interface
-t Interval
Examples

Launch glances

$ glances

Web interface

$ glances -w

pidof

Find PID of running program.

General
Syntax
pidof [OPTION]... PROGRAM...
Common Options
Option Description
-s Single PID
-x Include scripts
-o Omit PIDs
Examples

Find PID

$ pidof firefox

pmap

Report memory map of process.

System Admin
Syntax
pmap [OPTION]... PID
Common Options
Option Description
-x Extended format
-d Device format
-q Quiet mode
Examples

Show process memory

$ pmap 1234

strace

Trace system calls and signals.

System Admin
Syntax
strace [OPTION]... COMMAND
Common Options
Option Description
-p Attach to PID
-e Filter system calls
-f Follow child processes
-o Output to file
Examples

Trace command execution

$ strace ls

Attach to running process

$ strace -p 1234

ltrace

Trace library function calls.

General
Syntax
ltrace [OPTION]... COMMAND
Common Options
Option Description
-p Attach to PID
-e Filter functions
-f Follow children
-o Output to file
Examples

Trace library calls

$ ltrace ls

perf

Performance analysis tool for Linux.

General
Syntax
perf [SUBCOMMAND] [OPTION]...
Common Options
Option Description
stat Count events
record Record events
report Report events
top Real-time profiling
Examples

Count CPU cycles

$ perf stat command

Profile command

$ perf record -g command perf report

mpstat

Report CPU statistics per processor.

System Admin
Syntax
mpstat [OPTION]... [INTERVAL] [COUNT]
Common Options
Option Description
-P Specific CPU
-A All information
-u CPU usage
Examples

Show CPU stats

$ mpstat

Monitor every second

$ mpstat 1

iotop

Monitor I/O usage per process.

System Admin
Syntax
iotop [OPTION]...
Common Options
Option Description
-o Show only active processes
-b Batch mode
-d Delay
-n Number of iterations
Examples

Monitor I/O in real-time

$ sudo iotop

iftop

Monitor network bandwidth usage.

Networking
Syntax
iftop [OPTION]...
Common Options
Option Description
-i Interface
-n No DNS resolution
-f Filter packets
-p Promiscuous mode
Examples

Monitor network traffic

$ sudo iftop

Monitor specific interface

$ sudo iftop -i eth0

nload

Monitor network bandwidth with graphs.

Networking
Syntax
nload [OPTION]...
Common Options
Option Description
-u Unit (k/M/G)
-U Update interval
-t Graph refresh time
Examples

Monitor traffic

$ nload

ip

Show/manipulate network interfaces.

Networking
Syntax
ip [OPTION]... OBJECT {COMMAND}
Common Options
Option Description
link Network interface
addr IP addresses
route Routing table
neigh ARP table
Examples

Show interfaces

$ ip link show

Show IP addresses

$ ip addr show

ifconfig

Configure network interfaces (deprecated).

Networking
Syntax
ifconfig [OPTION]... [INTERFACE]
Common Options
Option Description
up Activate interface
down Deactivate
add Add address
del Remove address
Examples

Show interfaces

$ ifconfig

Configure interface

$ ifconfig eth0 192.168.1.10

iwconfig

Configure wireless network interface.

Networking
Syntax
iwconfig [OPTION]... [INTERFACE]
Common Options
Option Description
essid Network name
mode Operation mode
key Encryption key
freq Channel frequency
Examples

Show wireless settings

$ iwconfig

Connect to network

$ iwconfig wlan0 essid "MyNetwork"

iw

Modern wireless device configuration tool.

General
Syntax
iw [OPTION]... COMMAND
Common Options
Option Description
dev Device operations
phy Physical device
info Show info
scan Scan networks
Examples

List wireless devices

$ iw dev

Scan for networks

$ iw dev wlan0 scan

ss

Show socket statistics.

General
Syntax
ss [OPTION]...
Common Options
Option Description
-t TCP sockets
-u UDP sockets
-l Listening sockets
-n Numeric output
-p Process info
Examples

Show all TCP connections

$ ss -t

Show listening ports

$ ss -l

netstat

Display network connections and statistics.

Networking
Syntax
netstat [OPTION]...
Common Options
Option Description
-t TCP
-u UDP
-l Listening
-p Process info
-r Routing table
Examples

Show all connections

$ netstat -tulpn

Show routing table

$ netstat -r

route

Display/modify routing table.

General
Syntax
route [OPTION]...
Common Options
Option Description
-n Numeric output
add Add route
del Delete route
-A Address family
Examples

Show routing table

$ route -n

Add default gateway

$ route add default gw 192.168.1.1

arp

Display/modify ARP cache.

General
Syntax
arp [OPTION]...
Common Options
Option Description
-n Numeric output
-a Show all entries
-d Delete entry
-s Add entry
Examples

Show ARP table

$ arp -n

ping

Test network connectivity.

Networking
Syntax
ping [OPTION]... HOST
Common Options
Option Description
-c Count
-i Interval
-s Packet size
-4/-6 IPv4/IPv6
-W Timeout
Examples

Test connectivity

$ ping google.com

Ping with count

$ ping -c 5 8.8.8.8

ping6

Test IPv6 network connectivity.

Networking
Syntax
ping6 [OPTION]... HOST
Examples

Test IPv6 connectivity

$ ping6 ipv6.google.com

traceroute

Trace path to network host.

Networking
Syntax
traceroute [OPTION]... HOST
Common Options
Option Description
-n No DNS
-w Wait time
-m Max hops
-I ICMP packets
Examples

Trace route

$ traceroute google.com

No DNS resolution

$ traceroute -n 8.8.8.8

tracepath

Trace network path with MTU discovery.

Networking
Syntax
tracepath [OPTION]... HOST
Common Options
Option Description
-n Numeric output
-l Initial packet length
Examples

Trace path

$ tracepath google.com

mtr

Combined traceroute and ping tool.

Networking
Syntax
mtr [OPTION]... HOST
Common Options
Option Description
-r Report mode
-c Number of pings
-n No DNS
-i Interval
Examples

Run mtr

$ mtr google.com

Generate report

$ mtr -r -c 10 google.com

dig

DNS lookup utility.

General
Syntax
dig [OPTION]... DOMAIN [TYPE]
Common Options
Option Description
+short Short output
+trace Trace delegation
@server Specific server
-x Reverse lookup
Examples

Lookup A record

$ dig google.com

Short output

$ dig +short google.com

Reverse lookup

$ dig -x 8.8.8.8

host

Simple DNS lookup tool.

General
Syntax
host [OPTION]... DOMAIN [SERVER]
Common Options
Option Description
-a All records
-t Record type
-v Verbose
Examples

Lookup domain

$ host google.com

Specific record type

$ host -t MX google.com

nslookup

Query DNS nameservers.

General
Syntax
nslookup [OPTION]... [HOST]
Common Options
Option Description
-type= Record type
-timeout= Timeout
-debug Debug mode
Examples

Lookup domain

$ nslookup google.com

Interactive mode

$ nslookup

curl

Transfer data from/to servers.

General
Syntax
curl [OPTION]... URL
Common Options
Option Description
-o Output to file
-L Follow redirects
-v Verbose
-H Header
-d Data
-X Method
Examples

Download file

$ curl -O https://example.com/file.txt

Send POST request

$ curl -d "key=value" https://example.com/api

wget

Retrieve files from web.

File Management
Syntax
wget [OPTION]... URL
Common Options
Option Description
-O Output file
-c Resume download
-r Recursive
-q Quiet mode
-P Directory prefix
Examples

Download file

$ wget https://example.com/file.zip

Resume download

$ wget -c https://example.com/file.zip

aria2c

High-performance download utility.

General
Syntax
aria2c [OPTION]... URL
Common Options
Option Description
-x Connection count
-o Output file
-s Split count
-d Directory
Examples

Download file

$ aria2c https://example.com/file.zip

Download with multiple connections

$ aria2c -x 16 https://example.com/file.zip

ftp

Classic file transfer protocol client.

File Management
Syntax
ftp [OPTION]... [HOST]
Common Options
Option Description
-i Turn off interactive
-n No auto-login
-v Verbose
Examples

Connect to FTP

$ ftp example.com

sftp

SSH File Transfer Protocol client.

File Management
Syntax
sftp [OPTION]... [USER@]HOST
Common Options
Option Description
-b Batch file
-P Port
-v Verbose
Examples

Connect via SFTP

$ sftp user@example.com

scp

Copy files over SSH.

File Management
Syntax
scp [OPTION]... SOURCE TARGET
Common Options
Option Description
-r Recursive
-P Port
-i Identity file
-C Compression
Examples

Copy file to remote

$ scp file.txt user@host:/path/

Copy remote to local

$ scp user@host:/path/file.txt .

rsync

Efficient file synchronization.

File Management
Syntax
rsync [OPTION]... SOURCE DEST
Common Options
Option Description
-a Archive mode
-z Compression
-v Verbose
--delete Delete extra files
-P Progress
-e Remote shell
Examples

Sync local directory

$ rsync -av /source/ /dest/

Sync over SSH

$ rsync -avz -e ssh /local user@host:/remote/

ssh

Secure shell client for remote access.

User Management
Syntax
ssh [OPTION]... [USER@]HOST [COMMAND]
Common Options
Option Description
-p Port
-i Identity file
-v Verbose
-X X11 forwarding
-L Local forwarding
Examples

Connect to remote

$ ssh user@hostname

Run remote command

$ ssh user@hostname "ls -la"

ssh-keygen

Generate SSH key pairs.

General
Syntax
ssh-keygen [OPTION]...
Common Options
Option Description
-t Key type (rsa, ed25519)
-b Bits
-f Output file
-C Comment
-p Change passphrase
Examples

Generate SSH key

$ ssh-keygen -t ed25519 -C "email@example.com"

ssh-copy-id

Install public key to remote server.

General
Syntax
ssh-copy-id [OPTION]... [USER@]HOST
Common Options
Option Description
-i Identity file
-p Port
-f Force
Examples

Copy key to remote

$ ssh-copy-id user@hostname

ssh-agent

Manage SSH private keys.

General
Syntax
ssh-agent [OPTION]... [COMMAND]
Common Options
Option Description
-s Bourne shell output
-c C shell output
-k Kill agent
-t Timeout
Examples

Start agent

$ eval $(ssh-agent)

ssh-add

Add private key to ssh-agent.

General
Syntax
ssh-add [OPTION]... [FILE]
Common Options
Option Description
-l List keys
-d Delete key
-D Delete all
-t Timeout
Examples

Add default key

$ ssh-add

List loaded keys

$ ssh-add -l

telnet

Unencrypted remote terminal client.

General
Syntax
telnet [OPTION]... HOST [PORT]
Common Options
Option Description
-a Auto login
-l User
Examples

Connect via telnet

$ telnet hostname

nc

Network tool for reading/writing connections.

Networking
Syntax
nc [OPTION]... [HOST] [PORT]
Common Options
Option Description
-l Listen mode
-p Local port
-v Verbose
-u UDP
-z Zero I/O mode
Examples

Connect to server

$ nc example.com 80

Listen on port

$ nc -l 1234

ncat

Enhanced netcat implementation.

General
Syntax
ncat [OPTION]... [HOST] [PORT]
Common Options
Option Description
-l Listen
-k Keep listening
-s Source address
--ssl SSL encryption
Examples

Listen on port

$ ncat -l 1234

SSL listener

$ ncat --ssl -l 1234

socat

Multipurpose socket relay tool.

Networking
Syntax
socat [OPTION]... ADDRESS ADDRESS
Common Options
Option Description
-v Verbose
-x Hex dump
-d Debug
-T Timeout
Examples

Forward port

$ socat TCP-LISTEN:8080 TCP:localhost:80

tcpdump

Capture and analyze network packets.

Networking
Syntax
tcpdump [OPTION]... [EXPRESSION]
Common Options
Option Description
-i Interface
-n Numeric output
-w Write to file
-r Read from file
-c Count
-v Verbose
Examples

Capture packets

$ sudo tcpdump -i eth0

Save to file

$ sudo tcpdump -i eth0 -w capture.pcap

tshark

Wireshark command-line packet analyzer.

General
Syntax
tshark [OPTION]...
Common Options
Option Description
-i Interface
-r Read file
-Y Display filter
-w Write file
Examples

Capture packets

$ sudo tshark -i eth0

wireshark

Graphical network packet analyzer.

Networking
Syntax
wireshark [OPTION]...
Common Options
Option Description
-i Interface
-r Read file
-k Start capture
Examples

Start Wireshark

$ wireshark

nmap

Network discovery and security scanning.

Networking
Syntax
nmap [OPTION]... [HOST]
Common Options
Option Description
-sS SYN scan
-sU UDP scan
-p Port range
-O OS detection
-A Aggressive scan
Examples

Scan host

$ nmap 192.168.1.1

Scan with OS detection

$ sudo nmap -O 192.168.1.1

arp-scan

Discover hosts via ARP.

Networking
Syntax
arp-scan [OPTION]... [INTERFACE]
Common Options
Option Description
-l Local network
-r Retries
-t Timeout
Examples

Scan local network

$ sudo arp-scan -l

ethtool

Display/manage ethernet device settings.

General
Syntax
ethtool [OPTION]... DEVICE
Common Options
Option Description
-s Set settings
-k Offload settings
-p Blink LED
-g Ring buffer
Examples

Show interface info

$ ethtool eth0

Show link status

$ ethtool eth0 | grep Link

nmcli

NetworkManager command-line interface.

Networking
Syntax
nmcli [OPTION]... OBJECT {COMMAND}
Common Options
Option Description
dev Device operations
con Connection operations
radio Radio operations
general General settings
Examples

Show connections

$ nmcli con show

Connect to Wi-Fi

$ nmcli dev wifi connect "SSID" password "pass"

nmtui

NetworkManager text UI.

Networking
Syntax
nmtui [OPTION]...
Common Options
Option Description
edit Edit connection
connect Connect to network
hostname Set hostname
Examples

Launch NetworkManager TUI

$ nmtui

resolvectl

Control systemd-resolved DNS settings.

System Admin
Syntax
resolvectl [OPTION]... [COMMAND]
Common Options
Option Description
status Show status
set-dns Set DNS servers
query Query DNS
Examples

Show DNS status

$ resolvectl status

Set DNS server

$ resolvectl set-dns eth0 8.8.8.8

iptables

Configure IPv4 firewall rules.

Networking
Syntax
iptables [OPTION]... [COMMAND] [CHAIN] [RULE]
Common Options
Option Description
-A Append rule
-D Delete rule
-L List rules
-F Flush rules
-P Policy
Examples

List rules

$ sudo iptables -L

Allow port 80

$ sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT

nft

Nftables firewall tool (iptables replacement).

Networking
Syntax
nft [OPTION]... {COMMAND}
Common Options
Option Description
list List rules
add Add rule
delete Delete rule
flush Flush rules
Examples

List all rules

$ sudo nft list ruleset

Add rule

$ sudo nft add rule inet filter input tcp dport 80 accept

ufw

Simplified firewall management.

General
Syntax
ufw [OPTION]... [COMMAND]
Common Options
Option Description
enable Enable firewall
disable Disable firewall
allow Allow port/service
deny Deny port/service
status Show status
Examples

Enable firewall

$ sudo ufw enable

Allow SSH

$ sudo ufw allow ssh

firewall-cmd

FirewallD command-line interface.

General
Syntax
firewall-cmd [OPTION]... [COMMAND]
Common Options
Option Description
--state Show state
--zone Zone
--add-port Add port
--reload Reload rules
--list-all List all
Examples

Add service

$ sudo firewall-cmd --add-service=http

List all rules

$ sudo firewall-cmd --list-all

fail2ban-client

Fail2ban client for security monitoring.

General
Syntax
fail2ban-client [OPTION]... [COMMAND]
Common Options
Option Description
status Show status
reload Reload configuration
ping Test connection
Examples

Check status

$ sudo fail2ban-client status

docker

Docker container engine management.

General
Syntax
docker [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
ps List containers
run Run container
stop Stop container
rm Remove container
images List images
Examples

Run container

$ docker run hello-world

List containers

$ docker ps -a

docker-compose

Define and run multi-container Docker apps.

General
Syntax
docker-compose [OPTION]... [COMMAND]...
Common Options
Option Description
up Start containers
down Stop containers
logs View logs
exec Execute command
build Build services
Examples

Start services

$ docker-compose up -d

Stop services

$ docker-compose down

podman

Container management tool (daemonless).

General
Syntax
podman [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
ps List containers
run Run container
pull Pull image
push Push image
logs View logs
Examples

Run container

$ podman run hello-world

List containers

$ podman ps -a

buildah

Build container images.

General
Syntax
buildah [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
bud Build image
from Create working container
commit Save container
push Push image
Examples

Build image

$ buildah bud -t myimage .

skopeo

Manage container images.

General
Syntax
skopeo [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
inspect Inspect image
copy Copy image
sync Sync images
list-tags List tags
Examples

Inspect image

$ skopeo inspect docker://docker.io/library/nginx

nerdctl

Docker-compatible containerd CLI.

General
Syntax
nerdctl [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
ps List containers
run Run container
images List images
pull Pull image
Examples

Run container

$ nerdctl run hello-world

kubectl

Kubernetes command-line tool.

General
Syntax
kubectl [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
get Get resources
describe Describe resources
apply Apply configuration
logs View logs
exec Execute command
Examples

Get pods

$ kubectl get pods

Apply configuration

$ kubectl apply -f deployment.yaml

minikube

Run Kubernetes locally.

General
Syntax
minikube [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
start Start cluster
stop Stop cluster
delete Delete cluster
status Show status
dashboard Open dashboard
Examples

Start cluster

$ minikube start

Open dashboard

$ minikube dashboard

kind

Run Kubernetes clusters in Docker containers.

General
Syntax
kind [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
create Create cluster
delete Delete cluster
load Load images
export Export logs
Examples

Create cluster

$ kind create cluster

helm

Kubernetes package manager (Helm).

General
Syntax
helm [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
install Install chart
list List releases
upgrade Upgrade release
uninstall Uninstall release
Examples

Install chart

$ helm install nginx bitnami/nginx

List releases

$ helm list

crictl

Container runtime CLI for Kubernetes.

General
Syntax
crictl [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
ps List containers
images List images
pods List pods
logs View logs
Examples

List containers

$ crictl ps

systemctl

Control systemd services.

System Admin
Syntax
systemctl [OPTION]... COMMAND [NAME]...
Common Options
Option Description
start Start service
stop Stop service
restart Restart service
status Show status
enable Enable service
disable Disable service
Examples

Start service

$ sudo systemctl start nginx

Check status

$ systemctl status nginx

service

Run System V init scripts.

Networking
Syntax
service [OPTION]... SCRIPT [COMMAND]
Common Options
Option Description
--status-all Show all services
start Start service
stop Stop service
restart Restart service
Examples

Start service

$ sudo service nginx start

loginctl

Control systemd login sessions.

System Admin
Syntax
loginctl [OPTION]... [COMMAND]
Common Options
Option Description
list-sessions List sessions
list-users List users
show-user Show user info
lock-session Lock session
Examples

List sessions

$ loginctl list-sessions

busctl

Introspect D-Bus bus.

General
Syntax
busctl [OPTION]... [COMMAND]
Common Options
Option Description
list List services
introspect Introspect service
call Call method
monitor Monitor messages
Examples

List services

$ busctl list

systemd-analyze

Analyze systemd boot performance.

System Admin
Syntax
systemd-analyze [OPTION]... [COMMAND]
Common Options
Option Description
time Boot time
blame Service start times
critical-chain Critical path
plot Plot graph
Examples

Show boot time

$ systemd-analyze time

Find slow services

$ systemd-analyze blame

machinectl

Control systemd containers.

System Admin
Syntax
machinectl [OPTION]... [COMMAND]
Common Options
Option Description
list List containers
status Show status
login Login to container
shell Run shell
Examples

List containers

$ machinectl list

localectl

Control system locale/keymap settings.

System Admin
Syntax
localectl [OPTION]... [COMMAND]
Common Options
Option Description
status Show current settings
set-locale Set locale
set-keymap Set keymap
list-locales List locales
Examples

Show settings

$ localectl status

Set locale

$ sudo localectl set-locale LANG=en_US.UTF-8

bootctl

Control systemd-boot boot manager.

System Admin
Syntax
bootctl [OPTION]... [COMMAND]
Common Options
Option Description
status Show status
install Install boot loader
update Update entries
list List entries
Examples

Show boot status

$ bootctl status

systemd-run

Run commands as transient systemd units.

System Admin
Syntax
systemd-run [OPTION]... COMMAND
Common Options
Option Description
--unit Unit name
--description Description
--user User scope
Examples

Run command

$ systemd-run --unit=mytask command

apt

APT package management (modern).

General
Syntax
apt [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
update Update package lists
upgrade Upgrade packages
install Install package
remove Remove package
search Search packages
Examples

Update packages

$ sudo apt update

Install package

$ sudo apt install nginx

apt-get

Legacy APT package management.

General
Syntax
apt-get [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
install Install package
remove Remove package
update Update lists
upgrade Upgrade packages
Examples

Update packages

$ sudo apt-get update

apt-cache

APT package query tool.

General
Syntax
apt-cache [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
show Show package info
search Search packages
depends Show dependencies
stats Show statistics
Examples

Search for package

$ apt-cache search nginx

Show package info

$ apt-cache show nginx

dpkg

Debian package management tool.

General
Syntax
dpkg [OPTION]... [COMMAND]
Common Options
Option Description
-i Install package
-r Remove package
-l List packages
-s Show status
Examples

Install .deb

$ sudo dpkg -i package.deb

List installed

$ dpkg -l

dpkg-query

Query dpkg package database.

General
Syntax
dpkg-query [OPTION]... [COMMAND]
Common Options
Option Description
-l List packages
-s Show package status
-f Format output
Examples

List packages

$ dpkg-query -l

aptitude

Advanced package management frontend.

General
Syntax
aptitude [OPTION]... [COMMAND]
Common Options
Option Description
search Search packages
install Install package
remove Remove package
update Update lists
Examples

Search package

$ aptitude search nginx

snap

Snap package management.

General
Syntax
snap [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
install Install snap
remove Remove snap
list List snaps
find Find snaps
refresh Update snaps
Examples

Install snap

$ sudo snap install hello-world

List snaps

$ snap list

flatpak

Flatpak application management.

General
Syntax
flatpak [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
install Install app
uninstall Remove app
list List apps
run Run app
Examples

Install app

$ flatpak install flathub org.videolan.VLC

Run app

$ flatpak run org.videolan.VLC

rpm

RPM package management.

General
Syntax
rpm [OPTION]... [COMMAND]
Common Options
Option Description
-i Install package
-U Upgrade package
-e Erase package
-q Query package
-V Verify package
Examples

Install RPM

$ sudo rpm -i package.rpm

List installed

$ rpm -qa

yum

Yellowdog Updater Modified (legacy).

General
Syntax
yum [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
install Install package
remove Remove package
update Update packages
search Search packages
Examples

Install package

$ sudo yum install nginx

dnf

Modern RPM package manager (replaces yum).

General
Syntax
dnf [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
install Install package
remove Remove package
update Update packages
search Search packages
info Show info
Examples

Install package

$ sudo dnf install nginx

Search package

$ dnf search nginx

zypper

SUSE package management.

General
Syntax
zypper [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
install Install package
remove Remove package
update Update packages
search Search packages
Examples

Install package

$ sudo zypper install nginx

pacman

Arch Linux package manager.

General
Syntax
pacman [OPTION]... [COMMAND]
Common Options
Option Description
-S Install package
-R Remove package
-Q Query packages
-Sy Sync databases
Examples

Install package

$ sudo pacman -S nginx

Update system

$ sudo pacman -Syu

yay

Arch AUR package helper.

General
Syntax
yay [OPTION]... [COMMAND]
Common Options
Option Description
-S Install package
-R Remove package
-Q Query packages
-Y Yay commands
Examples

Install from AUR

$ yay -S package-name

paru

Arch AUR package helper (Rust-based).

General
Syntax
paru [OPTION]... [COMMAND]
Common Options
Option Description
-S Install package
-R Remove package
-Q Query packages
-G Get PKGBUILD
Examples

Install from AUR

$ paru -S package-name

emerge

Gentoo package manager.

General
Syntax
emerge [OPTION]... [COMMAND] [PACKAGE]
Common Options
Option Description
-p Pretend
-v Verbose
-u Update
-D Deep dependencies
Examples

Install package

$ sudo emerge -v nginx

Update system

$ sudo emerge -uD world

xbps-install

Void Linux package installer.

General
Syntax
xbps-install [OPTION]... [PACKAGE]...
Common Options
Option Description
-S Sync repository
-u Update packages
-r Root directory
Examples

Install package

$ sudo xbps-install -S nginx

apk

Alpine Linux package manager.

General
Syntax
apk [OPTION]... COMMAND [PACKAGE]...
Common Options
Option Description
add Install package
del Remove package
update Update repositories
upgrade Upgrade packages
Examples

Install package

$ apk add nginx

nix-env

Nix package management.

General
Syntax
nix-env [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
-i Install package
-e Erase package
-q Query packages
-u Upgrade packages
Examples

Install package

$ nix-env -iA nixpkgs.hello

guix

GNU Guix package manager.

General
Syntax
guix [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
package Package operations
build Build package
pull Update guix
Examples

Install package

$ guix package -i hello

tar

Tape archive utility.

Archiving
Syntax
tar [OPTION]... [ARCHIVE] [FILE]...
Common Options
Option Description
-c Create archive
-x Extract archive
-f Archive file
-v Verbose
-z gzip compression
-j bzip2 compression
Examples

Create tar

$ tar -cvf archive.tar files/

Extract tar

$ tar -xvf archive.tar

With gzip

$ tar -czvf archive.tar.gz files/

gzip

Compress files with gzip.

File Management
Syntax
gzip [OPTION]... [FILE]...
Common Options
Option Description
-d Decompress
-k Keep original
-v Verbose
-r Recursive
Examples

Compress file

$ gzip file.txt

Decompress

$ gunzip file.txt.gz

gunzip

Decompress gzip files.

File Management
Syntax
gunzip [OPTION]... [FILE]...
Common Options
Option Description
-c Output to stdout
-k Keep compressed file
-f Force
Examples

Decompress file

$ gunzip file.txt.gz

bzip2

Compress files with bzip2.

File Management
Syntax
bzip2 [OPTION]... [FILE]...
Common Options
Option Description
-d Decompress
-k Keep original
-v Verbose
-z Compress
Examples

Compress file

$ bzip2 file.txt

bunzip2

Decompress bzip2 files.

File Management
Syntax
bunzip2 [OPTION]... [FILE]...
Common Options
Option Description
-k Keep compressed file
-f Force
-v Verbose
Examples

Decompress

$ bunzip2 file.txt.bz2

xz

Compress files with LZMA.

File Management
Syntax
xz [OPTION]... [FILE]...
Common Options
Option Description
-d Decompress
-k Keep original
-v Verbose
-z Compress
Examples

Compress

$ xz file.txt

unxz

Decompress xz files.

File Management
Syntax
unxz [OPTION]... [FILE]...
Common Options
Option Description
-k Keep compressed
-f Force
Examples

Decompress

$ unxz file.txt.xz

zip

Create zip archives.

Networking
Syntax
zip [OPTION]... [ARCHIVE] [FILE]...
Common Options
Option Description
-r Recursive
-d Delete from archive
-u Update
-q Quiet
Examples

Create zip

$ zip archive.zip files/

unzip

Extract zip archives.

Networking
Syntax
unzip [OPTION]... [ARCHIVE]
Common Options
Option Description
-d Extract to directory
-l List contents
-n Never overwrite
-o Overwrite
Examples

Extract zip

$ unzip archive.zip

Extract to directory

$ unzip archive.zip -d /target/

7z

7-Zip file archiver.

File Management
Syntax
7z [OPTION]... COMMAND [ARCHIVE] [FILE]...
Common Options
Option Description
a Add to archive
x Extract
t Test archive
l List contents
Examples

Create 7z archive

$ 7z a archive.7z files/

Extract

$ 7z x archive.7z

unrar

Extract RAR archives.

Archiving
Syntax
unrar [OPTION]... COMMAND [ARCHIVE]
Common Options
Option Description
x Extract full path
e Extract without paths
l List contents
Examples

Extract RAR

$ unrar x archive.rar

rar

Create/extract RAR archives (proprietary).

Archiving
Syntax
rar [OPTION]... COMMAND [ARCHIVE] [FILE]...
Common Options
Option Description
a Add to archive
x Extract
t Test archive
Examples

Create RAR

$ rar a archive.rar files/

cpio

Copy files to/from archive.

File Management
Syntax
cpio [OPTION]... [MODE]
Common Options
Option Description
-i Extract
-o Create
-p Copy pass-through
-v Verbose
Examples

Create cpio archive

$ find . | cpio -ov > archive.cpio

Extract

$ cpio -iv < archive.cpio

ar

Create and manipulate archive files.

File Management
Syntax
ar [OPTION]... [ARCHIVE] [FILE]...
Common Options
Option Description
r Replace files
x Extract files
t List contents
d Delete files
Examples

Create archive

$ ar r archive.a file1.o file2.o

zstd

Zstandard compression tool.

Archiving
Syntax
zstd [OPTION]... [FILE]...
Common Options
Option Description
-d Decompress
-k Keep original
-o Output file
-v Verbose
Examples

Compress file

$ zstd file.txt

Decompress

$ zstd -d file.txt.zst

lz4

LZ4 compression tool.

Archiving
Syntax
lz4 [OPTION]... [FILE]...
Common Options
Option Description
-d Decompress
-z Compress
-k Keep original
Examples

Compress

$ lz4 file.txt

openssl

OpenSSL cryptography toolkit.

General
Syntax
openssl [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
enc Encryption
x509 Certificate
genrsa Generate RSA key
req Certificate request
s_client SSL client
Examples

Generate private key

$ openssl genrsa -out key.pem 2048

Encrypt file

$ openssl enc -aes-256-cbc -in file.txt -out file.enc

gpg

Encryption and signing tool.

General
Syntax
gpg [OPTION]... [COMMAND]
Common Options
Option Description
--gen-key Generate key
--encrypt Encrypt
--decrypt Decrypt
--sign Sign
--verify Verify
Examples

Encrypt file

$ gpg -c file.txt

Decrypt

$ gpg file.txt.gpg

sha256sum

Calculate SHA-256 hash.

General
Syntax
sha256sum [OPTION]... [FILE]...
Common Options
Option Description
-c Check checksums
-b Binary mode
Examples

Calculate hash

$ sha256sum file.txt

sha1sum

Calculate SHA-1 hash.

General
Syntax
sha1sum [OPTION]... [FILE]...
Common Options
Option Description
-c Check checksums
Examples

Calculate hash

$ sha1sum file.txt

md5sum

Calculate MD5 hash.

General
Syntax
md5sum [OPTION]... [FILE]...
Common Options
Option Description
-c Check checksums
Examples

Calculate MD5

$ md5sum file.txt

cksum

Calculate CRC checksum.

General
Syntax
cksum [OPTION]... [FILE]...
Common Options
Option Description
-a Algorithm
Examples

Calculate checksum

$ cksum file.txt

base64

Base64 encode/decode data.

General
Syntax
base64 [OPTION]... [FILE]
Common Options
Option Description
-d Decode
-w Wrap width
-i Ignore non-alphabet chars
Examples

Encode file

$ base64 file.txt

Decode

$ base64 -d encoded.txt

shred

Overwrite files to prevent recovery.

File Management
Syntax
shred [OPTION]... [FILE]...
Common Options
Option Description
-f Force
-n Number of passes
-v Verbose
-z Add zero pass
Examples

Secure delete

$ shred -vfz file.txt

chattr

Change file attributes on ext2/3/4.

File Management
Syntax
chattr [OPTION]... [FILE]...
Common Options
Option Description
+i Immutable
-i Remove immutable
+a Append only
-R Recursive
Examples

Make immutable

$ sudo chattr +i file.txt

lsattr

List file attributes.

File Management
Syntax
lsattr [OPTION]... [FILE]...
Common Options
Option Description
-R Recursive
-a Include hidden
-d Directories
Examples

List attributes

$ lsattr file.txt

cryptsetup

Manage LUKS encrypted volumes.

General
Syntax
cryptsetup [OPTION]... COMMAND [DEVICE]
Common Options
Option Description
luksFormat Create LUKS partition
luksOpen Open LUKS
luksClose Close LUKS
luksAddKey Add passphrase
Examples

Create encrypted partition

$ sudo cryptsetup luksFormat /dev/sdb1

Open

$ sudo cryptsetup luksOpen /dev/sdb1 myencrypted

veracrypt

VeraCrypt volume management.

General
Syntax
veracrypt [OPTION]... [COMMAND]
Common Options
Option Description
-t Text mode
-c Create volume
-m Mount volume
-d Dismount volume
Examples

Mount volume

$ veracrypt -t /path/to/volume.tc /mnt

dd

Convert and copy files/devices.

File Management
Syntax
dd [OPTION]...
Common Options
Option Description
if Input file
of Output file
bs Block size
count Number of blocks
status Progress display
Examples

Create disk image

$ dd if=/dev/sda of=disk.img bs=4M

Restore image

$ dd if=disk.img of=/dev/sda bs=4M

pv

Monitor data through pipeline.

Networking
Syntax
pv [OPTION]... [FILE]...
Common Options
Option Description
-s Size
-L Rate limit
-c Cursor movement
-p Progress bar
Examples

Copy with progress

$ pv file.txt > destination

od

Display file in octal/hex format.

File Management
Syntax
od [OPTION]... [FILE]...
Common Options
Option Description
-t Output type
-A Address base
-x Hex
-c ASCII chars
Examples

Display in hex

$ od -x file.bin

hexdump

Display file in hexadecimal.

File Management
Syntax
hexdump [OPTION]... [FILE]...
Common Options
Option Description
-C Canonical hex+ASCII
-n Length
-v Verbose
Examples

Hex dump

$ hexdump -C file.bin

xxd

Create hex dump or reverse.

General
Syntax
xxd [OPTION]... [FILE]
Common Options
Option Description
-r Reverse (hex to binary)
-p Plain hex
-i C include style
Examples

Hex dump

$ xxd file.bin

Reverse hex

$ xxd -r hex.txt > file.bin

hd

hexdump -C alias (hex+ASCII display).

General
Syntax
hd [OPTION]... [FILE]...
Examples

Display hex+ASCII

$ hd file.bin

iconv

Convert text file encoding.

File Management
Syntax
iconv [OPTION]... [FILE]...
Common Options
Option Description
-f From encoding
-t To encoding
-o Output file
Examples

Convert UTF-8 to ASCII

$ iconv -f UTF-8 -t ASCII//TRANSLIT file.txt

dos2unix

Convert DOS to Unix line endings.

General
Syntax
dos2unix [OPTION]... [FILE]...
Common Options
Option Description
-n New file
-k Keep timestamp
Examples

Convert file

$ dos2unix file.txt

unix2dos

Convert Unix to DOS line endings.

General
Syntax
unix2dos [OPTION]... [FILE]...
Common Options
Option Description
-n New file
-k Keep timestamp
Examples

Convert file

$ unix2dos file.txt

expand

Convert tabs to spaces.

General
Syntax
expand [OPTION]... [FILE]...
Common Options
Option Description
-t Tab width
Examples

Expand tabs to spaces

$ expand -t 4 file.txt

unexpand

Convert spaces to tabs.

General
Syntax
unexpand [OPTION]... [FILE]...
Common Options
Option Description
-t Tab width
-a Convert all spaces
Examples

Convert spaces to tabs

$ unexpand -t 4 file.txt

column

Format text into columns.

Text Processing
Syntax
column [OPTION]... [FILE]...
Common Options
Option Description
-t Table format
-s Column separator
-x Fill columns first
Examples

Format into columns

$ column -t file.txt

script

Record terminal session.

General
Syntax
script [OPTION]... [FILE]
Common Options
Option Description
-a Append
-q Quiet mode
-c Run command
Examples

Record session

$ script session.log

scriptreplay

Replay recorded terminal session.

General
Syntax
scriptreplay [OPTION]... TIMINGFILE SESSIONFILE
Common Options
Option Description
-s Speed factor
Examples

Replay session

$ scriptreplay timing.log session.log

expect

Programmed dialogue with interactive programs.

General
Syntax
expect [OPTION]... [FILE]
Common Options
Option Description
-c Execute command
-d Debug
-f Script file
Examples

Automate SSH

$ expect -c 'spawn ssh user@host; expect "password:"; send "pass\r"; interact'

screen

Terminal session manager.

General
Syntax
screen [OPTION]... [COMMAND]
Common Options
Option Description
-S Session name
-r Resume session
-ls List sessions
-d Detach session
Examples

Start new session

$ screen -S mysession

Resume

$ screen -r mysession

List

$ screen -ls

tmux

Modern terminal multiplexer.

Networking
Syntax
tmux [OPTION]... [COMMAND]
Common Options
Option Description
new New session
ls List sessions
attach Attach session
kill-session Kill session
Examples

New session

$ tmux new -s mysession

List sessions

$ tmux ls

Attach

$ tmux attach -t mysession

byobu

Enhanced tmux/screen wrapper.

General
Syntax
byobu [OPTION]... [COMMAND]
Examples

Start byobu

$ byobu

bash

GNU Bourne-Again SHell.

User Management
Syntax
bash [OPTION]... [FILE]
Common Options
Option Description
-c Execute command
-i Interactive mode
-x Debug mode
-v Verbose mode
Examples

Run script

$ bash script.sh

Execute command

$ bash -c "echo Hello"

sh

Bourne shell (typically dash or bash).

User Management
Syntax
sh [OPTION]... [FILE]
Common Options
Option Description
-c Execute command
-n Syntax check
Examples

Run script

$ sh script.sh

zsh

Z shell (enhanced bash alternative).

User Management
Syntax
zsh [OPTION]... [FILE]
Common Options
Option Description
-c Execute command
-i Interactive
Examples

Start zsh

$ zsh

fish

Friendly interactive shell.

User Management
Syntax
fish [OPTION]... [FILE]
Common Options
Option Description
-c Execute command
-i Interactive
Examples

Start fish

$ fish

dash

POSIX-compliant shell.

User Management
Syntax
dash [OPTION]... [FILE]
Common Options
Option Description
-c Execute command
Examples

Run script

$ dash script.sh

ksh

Korn shell.

User Management
Syntax
ksh [OPTION]... [FILE]
Common Options
Option Description
-c Execute command
Examples

Start ksh

$ ksh

csh

C shell.

User Management
Syntax
csh [OPTION]... [FILE]
Common Options
Option Description
-c Execute command
-f Fast startup
Examples

Start csh

$ csh

tcsh

Enhanced C shell.

User Management
Syntax
tcsh [OPTION]... [FILE]
Common Options
Option Description
-c Execute command
-f Fast startup
Examples

Start tcsh

$ tcsh

ash

Almquist shell (BusyBox).

User Management
Syntax
ash [OPTION]... [FILE]
Common Options
Option Description
-c Execute command
Examples

Start ash

$ ash

envsubst

Substitute environment variables in text.

Text Processing
Syntax
envsubst [OPTION]... [SHELL-FORMAT]
Common Options
Option Description
-v Variables
-V Show version
Examples

Substitute variables

$ echo 'Hello $USER' | envsubst

expr

Evaluate arithmetic and string expressions.

Text Processing
Syntax
expr [OPTION]... EXPRESSION
Common Options
Option Description
--help Help
--version Version
Examples

Arithmetic

$ expr 2 + 2

String length

$ expr length "hello"

test

Evaluate conditional expressions.

General
Syntax
test [OPTION]... EXPRESSION
Common Options
Option Description
-f File exists
-d Directory exists
-z String empty
-n String not empty
Examples

Test if file exists

$ test -f /etc/passwd && echo "Exists"

bc

Arbitrary precision calculator.

General
Syntax
bc [OPTION]... [FILE]
Common Options
Option Description
-l Math library
-q Quiet mode
-s POSIX mode
Examples

Calculate

$ echo "2+2" | bc

Math functions

$ echo "s(1)" | bc -l

dc

Reverse Polish notation calculator.

General
Syntax
dc [OPTION]... [FILE]
Common Options
Option Description
-e Execute expression
-f Execute file
Examples

Calculate

$ echo "2 2 + p" | dc

factor

Factor numbers into primes.

General
Syntax
factor [OPTION]... NUMBER...
Examples

Factor number

$ factor 100

crontab

Manage cron jobs.

General
Syntax
crontab [OPTION]... [FILE]
Common Options
Option Description
-e Edit crontab
-l List crontab
-r Remove crontab
-u User
Examples

Edit crontab

$ crontab -e

List jobs

$ crontab -l

at

Schedule one-time tasks.

General
Syntax
at [OPTION]... TIME
Common Options
Option Description
-f Read from file
-l List jobs
-d Delete jobs
-m Send mail
Examples

Schedule command

$ echo "command" | at 14:00

List jobs

$ at -l

batch

Schedule when system load is low.

System Admin
Syntax
batch [OPTION]...
Examples

Schedule command

$ echo "command" | batch

anacron

Cron alternative for systems not always on.

System Admin
Syntax
anacron [OPTION]... [JOB]...
Common Options
Option Description
-f Force run
-u Update timestamps
-s Serialize jobs
Examples

Run jobs

$ sudo anacron

cron

Cron daemon (normally not directly run).

General
Syntax
cron [OPTION]...
Common Options
Option Description
-f Foreground
-l Log level
-n No forks
Examples

Start cron

$ sudo cron -f

logger

Send messages to system log.

System Admin
Syntax
logger [OPTION]... [MESSAGE]
Common Options
Option Description
-t Tag
-p Priority
-i Include PID
-s Also stdout
Examples

Log message

$ logger "System starting"

With tag

$ logger -t myscript "Done"

logrotate

Rotate, compress, and mail logs.

Archiving
Syntax
logrotate [OPTION]... CONFIGFILE
Common Options
Option Description
-f Force
-v Verbose
-s State file
-d Debug
Examples

Run logrotate

$ sudo logrotate -v /etc/logrotate.conf

rsyslogd

System logging daemon.

System Admin
Syntax
rsyslogd [OPTION]...
Common Options
Option Description
-f Config file
-d Debug
-i PID file
-n No fork
Examples

Start rsyslog

$ sudo rsyslogd

syslog-ng

syslog-ng logging daemon.

General
Syntax
syslog-ng [OPTION]...
Common Options
Option Description
-f Config file
-d Debug
-e Error messages
-s Syntax check
Examples

Start syslog-ng

$ sudo syslog-ng

mail

Read and send mail.

General
Syntax
mail [OPTION]... [ADDRESS]
Common Options
Option Description
-s Subject
-a Attach file
-c CC
Examples

Send mail

$ echo "Body" | mail -s "Subject" user@example.com

mailx

Enhanced mail client.

General
Syntax
mailx [OPTION]... [ADDRESS]
Common Options
Option Description
-s Subject
-a Attach
-v Verbose
Examples

Send mail

$ echo "Body" | mailx -s "Subject" user@example.com

sendmail

Sendmail MTA (mail transport agent).

General
Syntax
sendmail [OPTION]... [ADDRESS]
Common Options
Option Description
-v Verbose
-t Read recipients from message
-f From address
Examples

Send mail

$ sendmail user@example.com < message.txt

mutt

Mutt email client.

General
Syntax
mutt [OPTION]... [ADDRESS]
Common Options
Option Description
-s Subject
-a Attach file
-f Mailbox file
Examples

Send mail

$ mutt -s "Subject" user@example.com < body.txt

alpine

Alpine email client.

General
Syntax
alpine [OPTION]...
Common Options
Option Description
-f Mailbox
-h Help
Examples

Start alpine

$ alpine

wall

Send message to all logged in users.

User Management
Syntax
wall [OPTION]... [MESSAGE]
Examples

Send message

$ wall "System will reboot in 5 minutes"

write

Send message to specific user.

User Management
Syntax
write [USER] [TTY]
Examples

Send message

$ write username Hello!

mesg

Control message reception.

General
Syntax
mesg [OPTION]... [COMMAND]
Common Options
Option Description
y Allow messages
n Block messages
v Verbose
Examples

Allow messages

$ mesg y

smbclient

SMB/CIFS file access client.

File Management
Syntax
smbclient [OPTION]... [SERVER]
Common Options
Option Description
-U User
-L List shares
-c Execute command
Examples

List shares

$ smbclient -L //server -U user

Connect

$ smbclient //server/share -U user

mount.cifs

Mount SMB/CIFS share.

Disk Usage
Syntax
mount.cifs [OPTION]... SOURCE TARGET
Common Options
Option Description
-o Options
-U User
-P Password
Examples

Mount share

$ sudo mount.cifs //server/share /mnt -o user=username

showmount

Show NFS exports.

General
Syntax
showmount [OPTION]... [HOST]
Common Options
Option Description
-e Show exports
-d Directories
-a All mounts
Examples

Show exports

$ showmount -e nfsserver

exportfs

Manage NFS exports.

General
Syntax
exportfs [OPTION]... [COMMAND]
Common Options
Option Description
-a Export all
-r Re-export
-u Unexport
Examples

Export shares

$ sudo exportfs -a

rpcinfo

Report RPC information.

General
Syntax
rpcinfo [OPTION]... [HOST]
Common Options
Option Description
-p Show ports
-t TCP
-u UDP
Examples

Show RPC services

$ rpcinfo -p

rpcbind

RPC port mapper.

General
Syntax
rpcbind [OPTION]...
Common Options
Option Description
-f Foreground
-w WARM
Examples

Start rpcbind

$ sudo rpcbind

nfsstat

Display NFS statistics.

General
Syntax
nfsstat [OPTION]...
Common Options
Option Description
-c Client stats
-s Server stats
-l List mounts
-n NFS stats
Examples

Show NFS stats

$ nfsstat

smbstatus

Show SMB connection status.

General
Syntax
smbstatus [OPTION]...
Common Options
Option Description
-L Locks
-S Shares
-u User
Examples

Show SMB status

$ smbstatus

smbpasswd

Change SMB password.

User Management
Syntax
smbpasswd [OPTION]... [USER]
Common Options
Option Description
-a Add user
-x Delete user
Examples

Change password

$ smbpasswd username

useradd

Create new user account.

User Management
Syntax
useradd [OPTION]... USER
Common Options
Option Description
-m Create home directory
-s Shell
-G Groups
-u UID
-p Password
Examples

Add user

$ sudo useradd -m -s /bin/bash username

adduser

Interactive user creation (Debian/Ubuntu).

User Management
Syntax
adduser [OPTION]... USER
Common Options
Option Description
--home Home directory
--shell Shell
--group Group
Examples

Add user

$ sudo adduser username

usermod

Modify user account.

User Management
Syntax
usermod [OPTION]... USER
Common Options
Option Description
-s Shell
-G Groups
-l Login name
-d Home directory
Examples

Change shell

$ sudo usermod -s /bin/zsh username

Add to group

$ sudo usermod -aG sudo username

userdel

Delete user account.

User Management
Syntax
userdel [OPTION]... USER
Common Options
Option Description
-r Remove home directory
-f Force
Examples

Delete user

$ sudo userdel username

groupadd

Create new group.

User Management
Syntax
groupadd [OPTION]... GROUP
Common Options
Option Description
-g GID
-r System group
Examples

Add group

$ sudo groupadd groupname

groupmod

Modify group.

User Management
Syntax
groupmod [OPTION]... GROUP
Common Options
Option Description
-n New name
-g New GID
Examples

Rename group

$ sudo groupmod -n newname oldname

groupdel

Delete group.

User Management
Syntax
groupdel [OPTION]... GROUP
Examples

Delete group

$ sudo groupdel groupname

gpasswd

Administer group password.

User Management
Syntax
gpasswd [OPTION]... GROUP
Common Options
Option Description
-a Add user
-d Delete user
-A Admins
-M Members
Examples

Add user to group

$ sudo gpasswd -a username groupname

newgrp

Change primary group.

User Management
Syntax
newgrp [OPTION]... [GROUP]
Examples

Switch group

$ newgrp groupname

vipw

Edit password file securely.

File Management
Syntax
vipw [OPTION]...
Common Options
Option Description
-g Edit group file
-s Shadow file
Examples

Edit passwd

$ sudo vipw

pwck

Check password file integrity.

File Management
Syntax
pwck [OPTION]... [FILE]
Common Options
Option Description
-q Quiet
-r Read-only
Examples

Check passwd

$ sudo pwck

grpck

Check group file integrity.

File Management
Syntax
grpck [OPTION]... [FILE]
Common Options
Option Description
-q Quiet
-r Read-only
Examples

Check group

$ sudo grpck

chage

Change password aging info.

User Management
Syntax
chage [OPTION]... USER
Common Options
Option Description
-l List aging info
-m Minimum days
-M Maximum days
-W Warning days
-E Expire date
Examples

List password info

$ chage -l username

Set max days

$ sudo chage -M 90 username

faillog

Display login failure records.

User Management
Syntax
faillog [OPTION]...
Common Options
Option Description
-u User
-m Max failures
-r Reset
-l Lock
Examples

Show failures

$ faillog

lastlog

Show last login times.

User Management
Syntax
lastlog [OPTION]...
Common Options
Option Description
-u User
-t Time window
-b Before time
Examples

Show all lastlog

$ lastlog

sudoedit

Edit files safely with elevated privileges.

File Management
Syntax
sudoedit [OPTION]... FILE...
Examples

Edit protected file

$ sudoedit /etc/hosts

getent

Get entries from administrative database.

General
Syntax
getent [OPTION]... DATABASE [KEY]...
Common Options
Option Description
-s Service
-i Ignore case
Examples

Get users

$ getent passwd

Get groups

$ getent group

ulimit

Display/set user resource limits.

User Management
Syntax
ulimit [OPTION]... [LIMIT]
Common Options
Option Description
-a All limits
-n Open files
-u Processes
-f File size
Examples

Show limits

$ ulimit -a

Set open files

$ ulimit -n 4096

lsof

List open files and processes.

File Management
Syntax
lsof [OPTION]...
Common Options
Option Description
-i Network
-u User
-p PID
-n No DNS
Examples

List open files

$ lsof

List network connections

$ lsof -i

fuser

Identify processes using files.

File Management
Syntax
fuser [OPTION]... FILE...
Common Options
Option Description
-v Verbose
-k Kill processes
-m Mounted filesystem
-n Namespace
Examples

Find process using file

$ fuser file.txt

Kill processes

$ fuser -k file.txt

lslocks

List file locks.

File Management
Syntax
lslocks [OPTION]...
Common Options
Option Description
-p PID
-u User
-n Sort numeric
Examples

List file locks

$ lslocks

lsns

List Linux namespaces.

General
Syntax
lsns [OPTION]...
Common Options
Option Description
-t Type
-p PID
-u User
Examples

List namespaces

$ lsns

nsenter

Run command in namespace.

General
Syntax
nsenter [OPTION]... [COMMAND]
Common Options
Option Description
-t PID
-n Network
-u UTS
-p PID namespace
Examples

Enter network namespace

$ nsenter -t 1234 -n ip addr

unshare

Run program in new namespace.

General
Syntax
unshare [OPTION]... [COMMAND]
Common Options
Option Description
-n Network
-u UTS
-p PID
-m Mount
Examples

Run in new network namespace

$ unshare -n bash

chroot

Change root directory.

File Management
Syntax
chroot [OPTION]... NEWROOT [COMMAND]
Common Options
Option Description
--userspec User/group
--groups Groups
Examples

Change root

$ sudo chroot /newroot bash

pivot_root

Change system root for initrd.

System Admin
Syntax
pivot_root [OPTION]... NEWROOT PUTOLD
Common Options
Option Description
-h Help
Examples

Pivot root

$ sudo pivot_root /newroot /oldroot

mountpoint

Check if directory is mount point.

File Management
Syntax
mountpoint [OPTION]... DIRECTORY
Common Options
Option Description
-d Print device number
-x Print mount point
Examples

Check mount

$ mountpoint /mnt

modprobe

Load kernel modules.

System Admin
Syntax
modprobe [OPTION]... MODULE
Common Options
Option Description
-r Remove module
-a Load multiple
-n Dry run
-v Verbose
Examples

Load module

$ sudo modprobe module_name

Remove

$ sudo modprobe -r module_name

insmod

Insert kernel module.

System Admin
Syntax
insmod [OPTION]... MODULE [SYMBOL=VALUE]...
Examples

Insert module

$ sudo insmod module.ko

rmmod

Remove kernel module.

File Management
Syntax
rmmod [OPTION]... MODULE
Common Options
Option Description
-f Force
-s Print to syslog
Examples

Remove module

$ sudo rmmod module_name

lsmod

List loaded kernel modules.

System Admin
Syntax
lsmod [OPTION]...
Examples

List modules

$ lsmod

modinfo

Display module information.

General
Syntax
modinfo [OPTION]... MODULE
Common Options
Option Description
-F Field
-k Kernel version
-n Show filename
Examples

Show module info

$ modinfo module_name

depmod

Generate module dependency files.

File Management
Syntax
depmod [OPTION]...
Common Options
Option Description
-a All modules
-n Dry run
-F System map
Examples

Generate dependencies

$ sudo depmod

udevadm

UDEV management tool.

General
Syntax
udevadm [OPTION]... COMMAND
Common Options
Option Description
info Query device info
monitor Monitor events
trigger Trigger events
settle Wait for events
Examples

Get device info

$ udevadm info -q path /dev/sda

Monitor events

$ sudo udevadm monitor

lsinitramfs

List initramfs archive content.

Archiving
Syntax
lsinitramfs [OPTION]... [INITRAMFS]
Common Options
Option Description
-l Long format
-v Verbose
Examples

List initramfs

$ lsinitramfs /boot/initrd.img-$(uname -r)

mkinitcpio

Build initramfs images (Arch).

General
Syntax
mkinitcpio [OPTION]...
Common Options
Option Description
-P All presets
-p Specific preset
-g Output file
-s Save report
Examples

Build initramfs

$ sudo mkinitcpio -p linux

dracut

Build initramfs (Fedora/RHEL).

General
Syntax
dracut [OPTION]... [INITRAMFS] [KERNELVERSION]
Common Options
Option Description
-f Force rebuild
-v Verbose
-m Add module
-o Omit module
Examples

Build initramfs

$ sudo dracut -f

grub-install

Install GRUB bootloader.

General
Syntax
grub-install [OPTION]... DEVICE
Common Options
Option Description
--root-directory Root directory
--target Platform
--recheck Recheck device map
--boot-directory Boot directory
Examples

Install GRUB

$ sudo grub-install /dev/sda

grub-mkconfig

Generate GRUB configuration.

General
Syntax
grub-mkconfig [OPTION]...
Common Options
Option Description
-o Output file
--root-directory Root directory
Examples

Generate config

$ sudo grub-mkconfig -o /boot/grub/grub.cfg

update-grub

Update GRUB configuration (Debian/Ubuntu).

General
Syntax
update-grub [OPTION]...
Examples

Update GRUB

$ sudo update-grub

efibootmgr

Manage EFI boot entries.

General
Syntax
efibootmgr [OPTION]...
Common Options
Option Description
-v Verbose
-c Create entry
-B Delete entry
-o Boot order
Examples

List entries

$ sudo efibootmgr -v

os-prober

Detect installed operating systems.

System Admin
Syntax
os-prober [OPTION]...
Common Options
Option Description
-a All partitions
-d Debug mode
Examples

Detect OS

$ sudo os-prober

grub-editenv

Edit GRUB environment variables.

General
Syntax
grub-editenv [OPTION]... [FILE] [COMMAND]
Common Options
Option Description
list List variables
set Set variable
unset Unset variable
Examples

List GRUB env

$ grub-editenv /boot/grub/grubenv list

xrandr

Configure X server outputs.

General
Syntax
xrandr [OPTION]...
Common Options
Option Description
--output Output name
--mode Resolution
--auto Auto-configure
--right-of Position
Examples

List displays

$ xrandr

Set resolution

$ xrandr --output HDMI-1 --mode 1920x1080

xinput

Configure X input devices.

General
Syntax
xinput [OPTION]...
Common Options
Option Description
list List devices
set-prop Set property
disable Disable device
enable Enable device
Examples

List input devices

$ xinput list

xset

Set X server preferences.

General
Syntax
xset [OPTION]...
Common Options
Option Description
b Bell
s Screensaver
dpms Display power management
Examples

Disable screensaver

$ xset s off

xprop

Display X window properties.

General
Syntax
xprop [OPTION]...
Common Options
Option Description
-root Root window
-id Window ID
-name Window name
-format Format
Examples

Get window info

$ xprop

xev

Display X events.

General
Syntax
xev [OPTION]...
Common Options
Option Description
-display Display
-name Window name
Examples

Monitor events

$ xev

xrdb

Manage X resource database.

General
Syntax
xrdb [OPTION]... [FILE]
Common Options
Option Description
-query Show resources
-merge Merge resources
-load Load resources
Examples

Load X resources

$ xrdb -merge ~/.Xresources

xdpyinfo

Display X server information.

General
Syntax
xdpyinfo [OPTION]...
Common Options
Option Description
-display Display
-query Query extensions
Examples

Get X info

$ xdpyinfo

xdg-open

Open file with default application.

File Management
Syntax
xdg-open [OPTION]... FILE
Examples

Open file

$ xdg-open document.pdf

Open URL

$ xdg-open https://google.com

xdg-mime

Query/manage MIME associations.

General
Syntax
xdg-mime [OPTION]... COMMAND [FILE]
Common Options
Option Description
query Query default
default Set default
Examples

Get default app

$ xdg-mime query default application/pdf

notify-send

Send desktop notifications.

General
Syntax
notify-send [OPTION]... [SUMMARY] [BODY]
Common Options
Option Description
-u Urgency
-t Timeout
-i Icon
Examples

Send notification

$ notify-send "Title" "Message"

zenity

Display GNOME dialog boxes.

General
Syntax
zenity [OPTION]...
Common Options
Option Description
--info Info dialog
--question Question
--entry Text input
--file-selection File picker
Examples

Show info

$ zenity --info --text="Hello"

yad

GTK dialog boxes (zenity fork).

General
Syntax
yad [OPTION]...
Common Options
Option Description
--info Info
--question Question
--form Form
--calendar Calendar
Examples

Show dialog

$ yad --info --text="Hello"

ffmpeg

Convert and process multimedia.

System Admin
Syntax
ffmpeg [OPTION]... [INPUT] [OUTPUT]
Common Options
Option Description
-i Input file
-c Codec
-b Bitrate
-s Size
-r Frame rate
Examples

Convert video

$ ffmpeg -i input.mp4 output.avi

Extract audio

$ ffmpeg -i video.mp4 -q:a 0 audio.mp3

ffplay

Simple media player.

General
Syntax
ffplay [OPTION]... [INPUT]
Common Options
Option Description
-i Input
-window_title Title
-fs Full screen
Examples

Play video

$ ffplay video.mp4

ffprobe

Display media file information.

File Management
Syntax
ffprobe [OPTION]... [INPUT]
Common Options
Option Description
-show_format Show format
-show_streams Show streams
-v Verbose
Examples

Get media info

$ ffprobe video.mp4

imagemagick

Image manipulation suite.

Networking
Syntax
convert [OPTION]... [INPUT] [OUTPUT]
Common Options
Option Description
-resize Resize
-rotate Rotate
-quality Quality
-format Output format
Examples

Resize image

$ convert input.jpg -resize 50% output.jpg

convert

Convert image format.

General
Syntax
convert [OPTION]... [INPUT] [OUTPUT]
Common Options
Option Description
-resize Resize
-rotate Rotate
-crop Crop
-quality Quality
Examples

Convert to PNG

$ convert image.jpg image.png

mogrify

Batch process images.

System Admin
Syntax
mogrify [OPTION]... [INPUT]...
Common Options
Option Description
-resize Resize
-format Format
-quality Quality
Examples

Resize all images

$ mogrify -resize 50% *.jpg

exiftool

Read/write metadata.

General
Syntax
exiftool [OPTION]... [FILE]
Common Options
Option Description
-a All tags
-r Recursive
-o Output file
Examples

Read metadata

$ exiftool image.jpg

mediainfo

Display media file information.

File Management
Syntax
mediainfo [OPTION]... [FILE]
Common Options
Option Description
-f Full output
Examples

Get media info

$ mediainfo video.mp4

sox

Sound processing tool.

System Admin
Syntax
sox [OPTION]... [INPUT] [OUTPUT]
Common Options
Option Description
-r Sample rate
-b Bit depth
-c Channels
trim Trim audio
Examples

Convert audio

$ sox input.wav output.mp3

pactl

Control PulseAudio.

General
Syntax
pactl [OPTION]... COMMAND
Common Options
Option Description
list List objects
set-sink-volume Set volume
set-sink-mute Mute
Examples

List sinks

$ pactl list sinks

Set volume

$ pactl set-sink-volume 0 50%

amixer

ALSA mixer control.

General
Syntax
amixer [OPTION]... COMMAND
Common Options
Option Description
scontrols Show controls
sget Get control
sset Set control
Examples

Set volume

$ amixer set Master 50%

alsamixer

ALSA mixer GUI.

General
Syntax
alsamixer [OPTION]...
Common Options
Option Description
-c Card
-V View
Examples

Start mixer

$ alsamixer

speaker-test

Test audio output.

General
Syntax
speaker-test [OPTION]...
Common Options
Option Description
-t Test type
-c Channels
-f Frequency
-l Loops
Examples

Test speakers

$ speaker-test -t wav

arecord

ALSA audio recorder.

General
Syntax
arecord [OPTION]... [FILE]
Common Options
Option Description
-f Format
-r Sample rate
-d Duration
-c Channels
Examples

Record audio

$ arecord -d 10 test.wav

aplay

ALSA audio player.

General
Syntax
aplay [OPTION]... [FILE]
Common Options
Option Description
-f Format
-r Sample rate
-D Device
Examples

Play audio

$ aplay test.wav

bluetoothctl

Control Bluetooth devices.

General
Syntax
bluetoothctl [OPTION]... [COMMAND]
Common Options
Option Description
power Power on/off
scan Scan for devices
pair Pair device
connect Connect device
Examples

Start Bluetooth

$ bluetoothctl power on

Scan devices

$ bluetoothctl scan on

hciconfig

Configure Bluetooth devices.

General
Syntax
hciconfig [OPTION]... [DEVICE]
Common Options
Option Description
up Enable
down Disable
hci HCI commands
Examples

Show devices

$ hciconfig -a

rfkill

Enable/disable wireless devices.

General
Syntax
rfkill [OPTION]... COMMAND
Common Options
Option Description
list List devices
block Block device
unblock Unblock device
Examples

List devices

$ rfkill list

Enable Wi-Fi

$ rfkill unblock wifi

lsmem

List memory blocks.

System Admin
Syntax
lsmem [OPTION]...
Common Options
Option Description
--summary Summary
--all All blocks
Examples

Show memory info

$ lsmem

lshw

Detailed hardware information.

General
Syntax
lshw [OPTION]...
Common Options
Option Description
-short Short output
-html HTML output
-xml XML output
-C Class
Examples

List hardware

$ sudo lshw

Summary

$ sudo lshw -short

smartctl

Monitor SMART data on drives.

General
Syntax
smartctl [OPTION]... DEVICE
Common Options
Option Description
-a All info
-H Health status
-t Test
-l Log
Examples

Check health

$ sudo smartctl -H /dev/sda

Show all info

$ sudo smartctl -a /dev/sda

hdparm

Get/set hard drive parameters.

General
Syntax
hdparm [OPTION]... DEVICE
Common Options
Option Description
-I Identify info
-t Read speed test
-T Cache test
-S Standby timeout
Examples

Get drive info

$ sudo hdparm -I /dev/sda

Test read speed

$ sudo hdparm -t /dev/sda

nvme

Manage NVMe drives.

General
Syntax
nvme [OPTION]... COMMAND [DEVICE]
Common Options
Option Description
list List devices
id-ctrl Controller info
smart-log SMART data
Examples

List NVMe drives

$ sudo nvme list

SMART info

$ sudo nvme smart-log /dev/nvme0

sensors

Read hardware sensors.

General
Syntax
sensors [OPTION]...
Common Options
Option Description
-A All chips
-u Raw output
-j JSON output
Examples

Read sensors

$ sensors

lm_sensors

Hardware sensor configuration.

General
Syntax
sensors-detect [OPTION]...
Common Options
Option Description
--auto Auto-detect
Examples

Detect sensors

$ sudo sensors-detect

turbostat

Report CPU frequency and power.

System Admin
Syntax
turbostat [OPTION]...
Common Options
Option Description
-c CPU
-v Verbose
-q Quiet
Examples

Monitor CPU

$ sudo turbostat

cpupower

CPU power management tool.

System Admin
Syntax
cpupower [OPTION]... COMMAND
Common Options
Option Description
frequency Manage frequency
idle Idle states
monitor Monitor stats
Examples

Set frequency governor

$ sudo cpupower frequency-set -g performance

stress

Simple stress testing tool.

General
Syntax
stress [OPTION]...
Common Options
Option Description
-c CPU workers
-m Memory workers
-d Disk workers
-i I/O workers
Examples

Stress CPU

$ stress -c 4

stress-ng

Advanced system stress tester.

System Admin
Syntax
stress-ng [OPTION]...
Common Options
Option Description
--cpu CPU stress
--vm Memory stress
--hdd Disk stress
--timeout Time limit
Examples

Stress all

$ stress-ng --cpu 4 --timeout 60s

fio

Flexible I/O tester.

General
Syntax
fio [OPTION]... [JOBFILE]
Common Options
Option Description
--rw Read/write type
--bs Block size
--size Test size
--runtime Runtime
Examples

Benchmark

$ fio --name=test --rw=read --size=1G

bonnie++

Filesystem benchmark.

File Management
Syntax
bonnie++ [OPTION]...
Common Options
Option Description
-d Directory
-s File size
-n Number of files
Examples

Run benchmark

$ bonnie++ -d /tmp -s 1G

sysbench

System benchmark tool.

System Admin
Syntax
sysbench [OPTION]... COMMAND
Common Options
Option Description
--test Test type
--cpu CPU test
--memory Memory test
--fileio File I/O test
Examples

CPU test

$ sysbench cpu run

Memory test

$ sysbench memory run

git

Distributed version control system.

System Admin
Syntax
git [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
init Create repository
clone Clone repository
add Add files
commit Commit changes
push Push to remote
pull Pull from remote
status Show status
log Show history
Examples

Initialize repo

$ git init

Clone repo

$ git clone https://github.com/user/repo.git

Add and commit

$ git add . git commit -m "Message"

gitk

Git repository browser.

General
Syntax
gitk [OPTION]...
Common Options
Option Description
--all Show all branches
Examples

Open gitk

$ gitk

tig

Git text-mode interface.

Text Processing
Syntax
tig [OPTION]...
Common Options
Option Description
status Show status
log Show log
diff Show diff
Examples

Launch tig

$ tig

svn

Subversion version control.

General
Syntax
svn [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
co Checkout
add Add files
commit Commit
update Update
log Show logs
Examples

Checkout

$ svn co https://svn.example.com/repo

Commit

$ svn commit -m "Message"

hg

Mercurial version control.

General
Syntax
hg [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
init Init repository
add Add files
commit Commit
push Push
pull Pull
log Show history
Examples

Init

$ hg init

Commit

$ hg commit -m "Message"

cvs

Concurrent Versions System.

System Admin
Syntax
cvs [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
checkout Checkout
update Update
commit Commit
add Add file
Examples

Checkout

$ cvs checkout repo

make

Build automation tool.

General
Syntax
make [OPTION]... [TARGET]...
Common Options
Option Description
-j Jobs
-f Makefile
-C Directory
-n Dry run
Examples

Build

$ make

With 4 jobs

$ make -j4

cmake

Cross-platform build system.

System Admin
Syntax
cmake [OPTION]... [SOURCE]
Common Options
Option Description
-B Build directory
-D Define variable
-G Generator
Examples

Configure

$ cmake -B build -DCMAKE_BUILD_TYPE=Release

Build

$ cmake --build build

meson

Meson build system.

System Admin
Syntax
meson [OPTION]... [COMMAND]
Common Options
Option Description
setup Configure
compile Build
install Install
test Run tests
Examples

Configure

$ meson setup build

Build

$ ninja -C build

ninja

Small build system.

System Admin
Syntax
ninja [OPTION]... [TARGET]
Common Options
Option Description
-C Directory
-j Jobs
-t Tools
Examples

Build

$ ninja

With 4 jobs

$ ninja -j4

gcc

Compile C programs.

General
Syntax
gcc [OPTION]... [FILE]...
Common Options
Option Description
-o Output file
-Wall Warnings
-g Debug info
-O Optimization
-I Include path
Examples

Compile

$ gcc -o program program.c

g++

Compile C++ programs.

General
Syntax
g++ [OPTION]... [FILE]...
Common Options
Option Description
-o Output
-std Standard
-Wall Warnings
Examples

Compile C++

$ g++ -std=c++17 -o program program.cpp

clang

LLVM C compiler.

General
Syntax
clang [OPTION]... [FILE]...
Common Options
Option Description
-o Output
-Wall Warnings
-g Debug
Examples

Compile

$ clang -o program program.c

clang++

LLVM C++ compiler.

General
Syntax
clang++ [OPTION]... [FILE]...
Common Options
Option Description
-o Output
-std Standard
Examples

Compile C++

$ clang++ -std=c++17 -o program program.cpp

gdb

GNU source-level debugger.

General
Syntax
gdb [OPTION]... [PROGRAM]
Common Options
Option Description
-p Attach to PID
-c Core file
-x Commands file
Examples

Debug program

$ gdb ./program

lldb

LLVM debugger.

General
Syntax
lldb [OPTION]... [PROGRAM]
Common Options
Option Description
-p Attach to PID
-c Core file
-o Command
Examples

Debug program

$ lldb ./program

objdump

Display object file info.

File Management
Syntax
objdump [OPTION]... [FILE]
Common Options
Option Description
-d Disassemble
-t Symbols
-h Section headers
Examples

Disassemble

$ objdump -d program

nm

Display symbol table.

General
Syntax
nm [OPTION]... [FILE]
Common Options
Option Description
-a All symbols
-g Global only
-S Size
Examples

List symbols

$ nm program

readelf

Display ELF file info.

File Management
Syntax
readelf [OPTION]... [FILE]
Common Options
Option Description
-h Header
-S Sections
-s Symbols
Examples

Read ELF

$ readelf -h program

strip

Strip symbols from binary.

Networking
Syntax
strip [OPTION]... [FILE]
Common Options
Option Description
-s Strip all
-g Strip debugging
-o Output file
Examples

Strip binary

$ strip program

objcopy

Copy/convert object files.

File Management
Syntax
objcopy [OPTION]... [INPUT] [OUTPUT]
Common Options
Option Description
-O Output format
-j Section
--strip Strip sections
Examples

Copy object

$ objcopy input.o output.o

addr2line

Convert address to source line.

General
Syntax
addr2line [OPTION]... [ADDRESS]...
Common Options
Option Description
-e Executable
-f Function name
-p Pretty print
Examples

Convert address

$ addr2line -e program 0x123456

size

Show section sizes.

General
Syntax
size [OPTION]... [FILE]
Common Options
Option Description
-A Berkeley format
-B SysV format
-d Decimal
Examples

Show sizes

$ size program

jq

Process JSON data.

System Admin
Syntax
jq [OPTION]... [FILTER] [FILE]
Common Options
Option Description
-r Raw output
-c Compact output
-f Filter file
Examples

Parse JSON

$ jq '.key' file.json

Pretty print

$ jq '.' file.json

yq

Process YAML data.

System Admin
Syntax
yq [OPTION]... [COMMAND] [FILE]
Common Options
Option Description
eval Evaluate expression
-i In-place edit
-y YAML output
Examples

Extract value

$ yq eval '.key' file.yaml

xmlstarlet

Process XML data.

System Admin
Syntax
xmlstarlet [OPTION]... COMMAND [FILE]
Common Options
Option Description
sel Select
ed Edit
tr Transform
Examples

Parse XML

$ xmlstarlet sel -t -v "/root/key" file.xml

sqlite3

SQLite database shell.

User Management
Syntax
sqlite3 [OPTION]... [DBFILE] [SQL]
Common Options
Option Description
-header Show headers
-list List mode
-csv CSV output
Examples

Open database

$ sqlite3 database.db

Run query

$ sqlite3 database.db "SELECT * FROM table;"

mysql

MySQL database client.

General
Syntax
mysql [OPTION]... [DATABASE]
Common Options
Option Description
-u User
-p Password
-h Host
-e Execute query
Examples

Connect

$ mysql -u root -p

Run query

$ mysql -u root -p -e "SHOW DATABASES;"

mariadb

MariaDB database client.

General
Syntax
mariadb [OPTION]... [DATABASE]
Common Options
Option Description
-u User
-p Password
-h Host
Examples

Connect

$ mariadb -u root -p

psql

PostgreSQL interactive terminal.

General
Syntax
psql [OPTION]... [DATABASE]
Common Options
Option Description
-U User
-h Host
-d Database
-c Execute command
Examples

Connect

$ psql -U username -d database

Run query

$ psql -c "SELECT * FROM table;"

redis-cli

Redis command-line client.

General
Syntax
redis-cli [OPTION]... [COMMAND]
Common Options
Option Description
-h Host
-p Port
-a Password
--scan Scan keys
Examples

Connect

$ redis-cli

Run command

$ redis-cli SET key value

mongosh

MongoDB shell.

User Management
Syntax
mongosh [OPTION]... [CONNECTION]
Common Options
Option Description
--host Host
--port Port
-u User
-p Password
Examples

Connect

$ mongosh "mongodb://localhost:27017"

php

PHP command-line interpreter.

General
Syntax
php [OPTION]... [FILE]
Common Options
Option Description
-a Interactive
-r Execute code
-f File
-m Modules
Examples

Run file

$ php script.php

Execute code

$ php -r "echo 'Hello';"

python

Python programming language.

General
Syntax
python [OPTION]... [FILE]
Common Options
Option Description
-c Execute code
-m Module
-i Interactive
-v Verbose
Examples

Run script

$ python script.py

Interactive

$ python -i

python3

Python 3 interpreter.

General
Syntax
python3 [OPTION]... [FILE]
Common Options
Option Description
-c Execute code
-m Module
-v Verbose
Examples

Run script

$ python3 script.py

pip

Python package installer.

General
Syntax
pip [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
install Install package
uninstall Uninstall
list List packages
freeze Freeze requirements
Examples

Install package

$ pip install package

List packages

$ pip list

pip3

Python 3 package manager.

General
Syntax
pip3 [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
install Install
list List
freeze Requirements
Examples

Install

$ pip3 install package

node

Node.js JavaScript runtime.

Networking
Syntax
node [OPTION]... [FILE]
Common Options
Option Description
-v Version
-e Execute code
-r Module
Examples

Run script

$ node script.js

REPL

$ node

npm

Node.js package manager.

General
Syntax
npm [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
install Install packages
uninstall Uninstall
init Initialize project
start Start script
test Run tests
Examples

Install

$ npm install package

Start

$ npm start

npx

Execute Node packages.

General
Syntax
npx [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
--package Package
-q Quiet
Examples

Run package

$ npx create-react-app app

yarn

Yarn JavaScript package manager.

Networking
Syntax
yarn [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
add Add package
remove Remove package
install Install dependencies
start Start script
test Run tests
Examples

Add package

$ yarn add package

Start

$ yarn start

pnpm

Fast, disk-efficient package manager.

Disk Usage
Syntax
pnpm [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
add Add package
install Install
remove Remove
start Start script
Examples

Add package

$ pnpm add package

deno

Modern JavaScript/TypeScript runtime.

Networking
Syntax
deno [OPTION]... [FILE]
Common Options
Option Description
run Run script
test Test
fmt Format
lint Lint
Examples

Run script

$ deno run script.ts

bun

JavaScript runtime and toolkit.

Networking
Syntax
bun [OPTION]... [FILE]
Common Options
Option Description
run Run script
test Test
install Install packages
start Start script
Examples

Run script

$ bun run script.js

java

Java application launcher.

General
Syntax
java [OPTION]... [CLASS]
Common Options
Option Description
-version Version
-cp Classpath
-jar JAR file
-X VM options
Examples

Run JAR

$ java -jar app.jar

Run class

$ java MyClass

javac

Java source compiler.

General
Syntax
javac [OPTION]... [FILE]...
Common Options
Option Description
-d Output directory
-cp Classpath
-source Source version
-target Target version
Examples

Compile

$ javac MyClass.java

jshell

Java REPL.

General
Syntax
jshell [OPTION]... [FILE]
Common Options
Option Description
--class-path Classpath
-v Verbose
Examples

Start REPL

$ jshell

kotlin

Kotlin application launcher.

General
Syntax
kotlin [OPTION]... [FILE]
Examples

Run script

$ kotlin script.kts

rustc

Rust programming language compiler.

General
Syntax
rustc [OPTION]... [FILE]
Common Options
Option Description
-o Output
-C Codegen options
-L Library path
Examples

Compile

$ rustc main.rs

cargo

Rust's build system and package manager.

System Admin
Syntax
cargo [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
build Build project
run Run project
test Run tests
add Add dependency
new New project
init Init project
Examples

New project

$ cargo new myproject

Build

$ cargo build

Run

$ cargo run

go

Go programming language tool.

General
Syntax
go [OPTION]... COMMAND [ARGUMENT]...
Common Options
Option Description
run Run program
build Build program
mod Module management
test Run tests
get Download packages
Examples

Run

$ go run main.go

Build

$ go build

perl

Perl programming language.

General
Syntax
perl [OPTION]... [FILE]
Common Options
Option Description
-e Execute code
-n Loop over input
-p Loop and print
-i In-place edit
Examples

Run script

$ perl script.pl

Execute command

$ perl -e 'print "Hello\n"'

ruby

Ruby programming language.

General
Syntax
ruby [OPTION]... [FILE]
Common Options
Option Description
-e Execute code
-c Syntax check
-v Verbose
-w Warnings
Examples

Run script

$ ruby script.rb

lua

Lua programming language.

General
Syntax
lua [OPTION]... [FILE]
Common Options
Option Description
-e Execute code
-l Load library
-i Interactive
Examples

Run script

$ lua script.lua

R

R statistical computing.

General
Syntax
R [OPTION]... [FILE]
Common Options
Option Description
-e Execute expression
-f File
--vanilla No save/restore
Examples

Run script

$ Rscript script.R

octave

GNU Octave numerical computation.

General
Syntax
octave [OPTION]... [FILE]
Common Options
Option Description
--eval Execute code
--no-gui Command line
-q Quiet
Examples

Run script

$ octave script.m

tldr

Simplified command documentation.

General
Syntax
tldr [OPTION]... COMMAND
Common Options
Option Description
-u Update cache
-p Platform
-l List commands
Examples

Get help for ls

$ tldr ls

tree

Display directory tree.

File Management
Syntax
tree [OPTION]... [DIRECTORY]
Common Options
Option Description
-L Depth
-d Directories only
-f Full path
-h Human readable
Examples

Show tree

$ tree

Limited depth

$ tree -L 2

watchman

Watch files and directories.

File Management
Syntax
watchman [OPTION]... COMMAND
Common Options
Option Description
watch Watch directory
trigger Trigger command
since Changes since
Examples

Watch directory

$ watchman watch /path

bat

Syntax-highlighted file viewer.

File Management
Syntax
bat [OPTION]... [FILE]
Common Options
Option Description
-A Show non-printable
-n Number lines
-p Plain output
-l Language
Examples

View file

$ bat file.txt

Frequently Asked Questions

How many commands are in the database?

The explorer covers 200+ essential Linux commands across file management, networking, system administration, and text processing.

Discover More Tools

Explore our full collection of free, privacy-first developer and SEO tools.

Browse All Tools