Linux Command Reference
Shell Commands from A to Z
Book Information
- Publisher: SAP PRESS
- Authors: Michael Kofler
- Year: 2025
- Edition: 1
- Pages: 491
- Language: English
Description
Linux users, your go-to desktop reference is here! Find practical commands for the Linux tasks you perform, from managing files to working with graphics systems to programming with Bash. Commands are grouped by topic and listed alphabetically to help you quickly find what you’re looking for, and options are listed for each entry to help you modify your commands. With detailed descriptions and practical examples, this guide doesn’t just tell you which commands to use—it shows you how to use them, too!
- More than 500 Linux commands and configuration files at your fingertips
- Explore commands by topic and alphabetically
- Learn to use commands with detailed examples and instructions
Key Highlights
- Syntax references
- Keyboard shortcut references
- File system and network administration
- SELinux, AppArmor, iptables, and nft
- Package management, snap, and flatpack
- Printer, database, and server administration
- Cloud and virtualization: aws, docker, kvm, and virsh
- WLAN, Bluetooth, and other hardware
- System start/stop, init system, and GRUB
- acme.sh, certbot, and openssl certificates
- Windows integration with wsl
You'll learn about
- Over 500 Linux Commands:
Look up essential commands or find new ones based on your area of interest. You’ll also find handy references such as central configuration file syntax and handy keyboard shortcuts.
- Detailed Descriptions:
Go beyond the basics to understand the why and how of each command. Learn about distribution-specific features, commonly used shell tools, and typical use cases. Discover alternative options you can use to modify and enhance commands.
- Practical Examples:
What do the columns in /etc/fstab mean? How does vim delete the current line? Where does systemd store unit files? Get answers to questions like these with practical explanations of each command.
Table of Contents
- Overview of Commands Sorted by Topic
- Managing Files
- Finding Files
- Compressing and Archiving Files
- Processing Text Files
- Access Control Lists (ACLs) and Extended Attributes (EAs)
- Converters
- Managing Processes
- Managing Users and Groups
- Administrating the File System
- Logical Volume Manager (LVM)
- SELinux and AppArmor
- Package Management
- Network Administration
- Hacking and Security
- Printer, Database, and Server Administration
- Audio Functions and Hardware Management
- Bluetooth
- Kernel
- System Start and Stop, init System, Logging, and GRUB
- Virtualization, Containers, Cloud
- Terminal and Text Console
- Online Help
- Graphics System and Gnome
- Miscellaneous
- “bash” Programming
- “bash” Variable Management
- Additional “bash” Commands and Special Characters
- Configuration Files
- Keyboard Shortcuts
- Commands from A to Z
- aacomplain program
- Example
- aadisable program
- aaenforce program
- aastatus [option]
- Example
- ack [options] search term
- Example
- acme.sh [options]
- Example
- Alternatives
- acpi [options]
- addaptrepository ppa:name
- Example
- addgroup [options] name
- adduser [options] nameadduser name group
- Example
- alias abbreviation=command
- Example
- alien [options] package file
- alsactl [options] [command] [card/id/device]
- alsamixer [options]
- alternatives [options] command
- amixer [options] [command]
- Example
- apk command
- Example
- apropos topic
- Example
- apt command
- Example
- aptcache command
- Examples
- aptfile [options]
- Example
- aptget [options] command
- Example
- aptkey command
- aptitude [options] [command]
- aptitude search
- Examples
- arp [options] [hosts/ipaddresses/network]
- arpscan [options] [hosts/ipadresses/network]
- Example
- at [options] time
- Time Specification
- Options
- Example
- atq
- atrm n
- attr [options] files
- awk [options] 'code' text filesawk [options] f code file text files
- Examples
- aws [options] main command [subcommand] [parameter]
- Installation and Commissioning
- Syntax and Online Help
- S3 Administration
- EC2 Administration
- Example
- badblocks device
- basename string [ending]
- Example
- bat text file
- batch
- Example
- bc [file]
- Examples
- Alternatives
- bg [process]
- blkid [options] [device]
- Examples
- bluetoothctl
- Example
- boltctl command
- break [n]
- btrfs command
- Example
- Documentation
- bunzip2 file.bz2
- bzip2 file
- Example
- cadaver [options] [files]
- Example
- canonicallivepatch [command]
- Example
- case expression in pattern1 ) commands;; pattern2 ) commands;; ... esac
- Example
- cat [options] [files]
- Examples
- Variants
- cd [directory]
- cfdisk [options] device
- chacl [options] files
- chage [options] loginname
- Examples
- chattr [options] +=[aAcCdDeijsStTu] files
- Example
- chcon [options] context fileschcon [options] reference=reference file fileschcon [options] [u user] [r role] [t type] [l level] files
- Examples
- chgrp [options] group files
- Example
- chkrootkit [options]
- Example
- Variants
- chmod [options] changes files
- setuid, setgid, and sticky Bits
- Octal Notation
- Options
- Examples
- chown [options] user[:group] files
- Example
- chpasswd [options]
- Example
- chroot directory [command]
- Example
- chsh s shell [user]
- Example
- chvt n
- cksum file
- clear
- cmp [options] file1 file2
- cnf command
- Example
- column [options] file
- compress [options] file
- continue [n]
- convert or magick [options] image old image new
- Examples
- cp [optionen] source targetcp [options] files target directory
- Copying Directories
- Examples
- cpio command [options]
- Example
- crontab [options]
- cryptsetup [options] command
- Example
- csplit [options] file splitting position
- Specification of the Splitting Positions
- Options
- Example
- curl [options] [url]
- Examples
- Alternatives
- cut [options] file
- Example
- date [options] [+format]
- Examples
- dconf command
- Examples
- dd options
- Examples
- Alternatives
- declare [options] var[=value]
- delgroup [options] name
- delta [options] file1 file2
- deluser [options] name deluser name group
- depmod [options]
- df [options] [directory]
- Example
- Alternatives
- dhclient interface
- Example
- diff [options] file1 file2
- Example
- Alternatives
- dig [options] [@dnsserver] host/ipaddr [type]
- Example
- dircolors [optionen] [file]
- Example
- dirname string
- dirs
- disown [options] [jobspec]
- Example
- dmesg [options]
- dnf [options] command
- Examples
- docker [options] command
- Example
- dpkg options [filename/packagename]
- Example
- dracut [options] initrd file kernel version
- Example
- du [options] [directory]
- Example
- Alternatives
- dumpe2fs device
- dvips [options] name.dvi
- e4defrag [options] file/directory/device
- echo [options] string
- Example
- efibootmgr [options]
- Example
- egrep [options] search pattern file
- enscript [options] source file p target file
- epstopdf [options] file.eps
- erd [options] files
- etherwake [options] mac
- Example
- ethtool [options] device [parameter]
- Example
- eval $var
- Example
- exec command
- exfatlabel device [label]
- exiftool [options] file/directory
- Example
- exit [return value]
- expand [options] file
- Example
- export [options] variable [=value]
- exportfs [options]
- expr expressionexpr string : pattern
- Examples
- fail2banclient [options] command
- Examples
- fclist [pattern]
- fdisk [options] [device]
- ffmpeg [inopts] [i infile] [outopts] outfile
- Example
- fg [process]
- fgconsole [nextavailable]
- file [options] file
- Example
- find [path] [search options]
- General Options
- Search Criteria
- Actions When Finding a File
- Examples
- Alternatives
- findmnt [options] [device/mountpoint]
- Example
- firewallcmd options
- Options
- Examples
- flatpak [options] command
- Examples
- fold [options] file
- for var [in list;] do commandsdone
- Example
- free [options]
- Example
- fsck [options] device
- fsck.ext2 [options] devicefsck.ext3 [options] devicefsck.ext4 [options] device
- fstrim [options] mount directory
- Example
- ftp [options] ftpserver
- [function] name {{commands}
- Example
- fuser file name
- Example
- fwupdmgr command
- Example
- fx file.json
- fzf [options]
- getcap [options] file name
- Example
- getenforce
- getfacl [options] file name
- getfattr [options] file name
- getopts "format"
- Example
- Alternatives
- git command [options/parameters]
- Commands
- Revision Syntax
- Examples
- glances [options]
- gnomesessionquit [options]
- gpasswd [options] group
- gpg or gpg2 [options/commands]
- Examples
- gpioget [options] chipnr gpio1 gpio2 ...gpioset [options] chipnr gpio1=status1 gpio2=status2 ...
- Alternatives
- grep [options] search pattern filegrep R [options] search pattern
- Examples
- Variants of grep
- grim [options] filename.png
- Examples
- groupadd name
- groupdel name
- groupmod [options] name
- Example
- groups [username]
- Example
- grubinstall [device]grub2install [device]
- Example
- grubmkconfig [options]grub2mkconfig [options]
- gsettings command
- Example
- gunzip file
- gzip [options] file
- Examples
- halt [options]
- hash [option]
- hciconfig [hcidevice] [command]
- hcitool [options] [command]
- Commands
- Example
- head [options] file
- Alternatives
- help name
- history [options] [n]
- host [options] name/ipaddress
- Example
- hostname [name]
- hostnamectl [options] [command]
- Example
- htop [options]
- htpasswd [options] password file username [password]
- Example
- hwclock [options]
- hydra [options] [hostname/ipaddress] service
- Example
- Alternatives
- iconv f charset1 t charset2 in.txt > out.txt
- id
- Example
- if condition; then commands[elif condition; then commands][else commands]fi
- ifconfig interface [options] [ipaddress]
- iftop [options]
- ifup interfaceifdown interface
- Example
- info [command name]
- init [n]
- inotifywait [options] [files/directories]
- Example
- insmod [options] module file [parameter=value ...]
- install [options] source target
- Example
- inxi [options]
- Example
- ionice [options] [command]
- Example
- iotop
- ip [options] object command
- Example
- ipcalc ipadress [netmask]
- iptables [options]ip6tables [options]
- iptables P chain policy [t table]
- iptables A chain [t table] options
- iptables N mychain
- iptables L [chain] [t table] [v]
- iptables D chain [t table] options
- iptables F chain [t table]
- iptables X [mychain]
- Example
- ip[6]tablessave [options]ip[6]tablesrestore [options]ip[6]tablesxml [options]
- iw object command
- Example
- j directory
- john [options] [hashfile]
- Example
- Alternatives
- journalctl [options] [search expression]
- Examples
- jq [options] filter expression [file.json]
- Examples
- kbdrate [options]
- kexec [options]
- Example
- kill [s signal] processno
- killall [signal] process name
- Example
- kpartx [diskdevice]
- Example
- kvm [options] [imagefile]
- l2ping [options] bluetoothmac
- lame [options] in out.mp3
- Example
- last [options]
- Example
- lastb [options]
- ldconfig
- ldd program
- Example
- less [options] file
- lftp [options] [site]
- Example
- libcamerastill [options]libcameravid [options]
- ll [options] files
- ln [options] source [target]ln [options] files target directory
- Example
- loadkeys [options] file name
- Example
- local var[=value]
- localectl [options] [command]
- Options
- Commands
- Example
- locate pattern
- logger [options] message
- Example
- loginctl [options] [command] [name]
- Example
- logname
- logout
- lpadmin [options]
- lpinfo [options]
- lpoptions [options]
- lpq [options]
- lpr file
- lprm [options] [id]
- lpstat [options]
- ls [options] [path]
- Example
- Alternatives
- lsattr [options] files
- Example
- lsblk [options] [iodevice]
- Example
- lsb_release [options]
- Example
- lscpu [options]
- lshw [options]
- Example
- lsmod
- lsof [options] [file/interface]
- Examples
- lspci [options]
- lsscsi [options]
- Example
- lsusb [options]
- Example
- lvcreate [options] name
- Example
- lvdisplay [options] lvname
- lvextend [options] lvname [pvname]
- lvm [command]
- lvreduce [options] lvname
- lvremove [options] lvname
- lvrename oldlvname newlvname
- lvscan [options]
- lz4 [options] [filename]lzop [options] [filename]
- Examples
- magick [options] imageold imagenew
- mail [options] mail@hostname [< message text]
- Example
- makepasswd [options]
- Example
- man [group] [options] name
- md5sum files
- mdadm [options]
- Examples
- mkdir directory
- mkfifo file
- Example
- mkfs [options] device [blocks]
- mkfs.btrfs [options] device1 [device2 device3 ...]
- Example
- mkfs.exfat [options] device
- mkfs.ext2 [options] device [blocks]mkfs.ext3 [options] device [blocks]mkfs.ext4 [options] device [blocks]mke2fs [options] device [blocks]
- Example
- mkfs.ntfs [options] device
- mkfs.vfat [options] device
- Example
- mkfs.xfs [options] device
- mknod devicefile [b|c] major minor
- mkpasswd [options]
- Example
- mkswap device/file
- Example
- modinfo module name
- modprobe [options] module name [parameter=value ...]
- mogrify [options] image file
- Example
- more file
- mountmount [options] device directory
- General mount Options
- General File System Options
- btrfs Options
- CIFS Options
- exFAT Options
- ext3/ext4 Options
- ext3/ext4 Journaling Modes
- NFS Options
- NTFS Options
- VFAT Options
- XFS Options
- Examples
- mtr [options] host name
- Example
- multitail [options] file1 [file2 file3 ...]
- mv source targetmv files target directory
- Example
- mysql [options] [database name] [ < name.sql]
- Example
- Alternatives
- mysqladmin [options] command1 command2 ...
- Example
- mysqlbinlog [options] loggingfile1 file2 ...
- Example
- mysqldump [options] dbname [table1 table2 ...]mysqldump [options] databases [dbname1 dbname2 ...]mysqldump [options] alldatabases
- Examples
- namei [options] file
- nc [options] [hostname/ipaddress] [port]
- Examples
- ncdu [options] [directory]
- Example
- needsrestarting [options]
- Example
- netplan [command]
- netstat [options]
- Example
- networkctl [command]
- Examples
- newaliases
- newgrp [group name]
- Example
- newusers file
- Example
- nft command [options]
- nft Terminology
- nft Options
- nft Commands
- Examples
- ngrep [options] [grepsearchexpression] [pcapfilterexpression]
- Example
- nice [options] program
- Example
- nl [options] file
- nmap [options] hostname/ipaddress/ipaddressrange
- Examples
- nmblookup [options] workgroupname
- Example
- nmcli [options] con|dev|nm command
- Examples
- nohup command
- Example
- nproc
- nvidiaxconfig [options]
- openssl command
- Examples
- pacman [options]
- Examples
- Alternatives
- pactl command [parameter]
- Example
- pandoc [options] in1 [in2 in3 ...] [> out]
- Examples
- paplay [options] [file]parecord [options] [file]
- Example
- paps [options] text files > out.ps
- Example
- parallel [options] ['command']
- Examples
- parted [options] [device [command [options]]]
- Examples
- partprobe [options] [devices]
- partx [options] [partition] [disk]
- Example
- passwd [options] [username]
- Example
- paste file1 file2 . . .
- patch [options] < patch file
- Example
- pdf2ps source.pdf [target.ps]
- pdfimages [options] file.pdf [image name]
- Example
- pdftk file1.pdf file2.pdf . . . command
- Examples
- pdftops [options] source.pdf [target.ps]
- pdftotext [options] source.pdf [target.txt]
- pdfunite in1.pdf in2.pdf . . . out.pdf
- pg_dump [options] [> backup.sql]
- Example
- pidof program name
- Example
- pinctrl command
- Example
- ping [options] addressping6 [options] address
- pip or pip3 command
- Example
- pkcon command
- popd
- postconf [options] [parameter[=value]]
- postqueue [options]
- powertop
- ppapurge ppa:ppaowner[/ppaname]
- Example
- printenv [variable]
- printf format para1 para2 para3 ...
- Example
- pro command
- Example
- ps [options]
- Examples
- ps2pdf [options] source.ps [target.pdf]
- Example
- psql [options]
- Example
- pssh [options] commandpscp [options] local_file remote_filepnuke [options] pattern
- Example
- pstree [options] [pid]
- pushd directory
- pvcreate [options] device
- Example
- pvdisplay device
- pvremove device
- pvscan
- pwcat audio filepwcli [command]pwmon [options]pwtop [options]
- pwd
- Example
- pwgen [options] [n]
- Example
- qalc [expression]
- qemu [options] [imagefile]
- Example
- qemuimg command
- Examples
- rclone command
- Example
- rdfind [options] directory1 directory2
- Examples
- rdiffbackup [options] source directory target directory
- Examples
- read [var1 var2 var3 ...]
- readonly
- reboot [options]
- recode character set1..character set2 filerecode character set1..character set2 < source > target
- Examples
- rename
- rename on Debian, Raspberry Pi OS, and Ubuntu
- rename on Fedora, RHEL, and SUSE
- renice n pid
- reset
- resize2fs [options] device [size]
- Example
- resolvectl [options] command [name]
- Example
- restorecon [options] files
- Example
- rfkill command
- Example
- rkhunter [options]
- Example
- rm [options] files
- Examples
- rpicamstill [options]
- Example
- Variants
- rpicamvid [options]
- Example
- rmdir [options] directory
- rmmod [options] module name
- route [options]route add/del [net/host] target address [options]
- Example
- rpcinfo [options]
- rpm options [filename/package name]
- Examples
- rpm2archive name.rpmrpm2cpio name.rpm
- rsync [options] sourcersync [options] source target
- Examples
- scp [options] source target
- Examples
- screen [options] [ttydevice]
- Example
- scrot [options]
- Example
- sdptool [options] command
- Example
- sealert [options]
- sed [options] command [< source > target]
- Example
- seq [options] endseq [options] start endseq [options] start delta end
- Examples
- sestatus [options]
- Example
- set
- setcap [options] capability file name
- Example
- setenforce 0|1|Enforcing|Permissive
- setfacl [options] [aclaction] file name
- Examples
- setfattr [options] file name
- Examples
- setsebool [options] bool1=value1 bool2=value2 ...
- Example
- setterm [option]
- Example
- sfdisk [options]
- Example
- sftp [options] sshserversftp [optionen] user@sshserver:filename
- sgdisk [option] device
- Example
- shansum files
- Example
- shift [n]
- showmount [options]
- Example
- shutdown [options] time [message]
- sleep time
- slurp
- smartctl options device
- Example
- smbclient [options]smbclient directory [password] [options]
- Example
- smbpasswd [options] [name]
- smbstatus [options]
- snap [options] command
- Example
- snapper [options] command
- sort [options] file
- Example
- source file
- speakertest [options]
- Example
- split [options] file [target file]
- Example
- sqlite3 [options] database filesqlite3 [options] database file "sqlcommand1;sql2;..."
- Example
- ss [options]
- Example
- ssh [options] computer namessh [options] computer name command
- Examples
- sshcopyid [options] user@host
- sshkeygen [options]
- Example
- stat [options] files
- Example
- strace [options] command
- strings [options] file
- Examples
- su [options] [user]
- sudo [options] [var1=value1 var2=value2] command
- Examples
- Example with Input/Output Redirection
- swaks [options]
- swapon [options] deviceswapoff device
- sync
- sysctl options
- Example
- systemctl command
- Examples
- systemdanalyze command
- tac file
- tail [options] file
- Example
- tar action [options] filestar action [options] directories
- Actions
- Options
- Examples
- tasksel
- Example
- tcpdump [options] [filter expression]
- Options
- Filter Expression
- Examples
- tee file
- Example
- telnet [options] host [port]
- Example
- test expression
- Character Strings
- Numbers
- Files (Excerpts)
- Linked Conditions
- bash Variant [[ expression ]]
- Example
- time command
- Example
- Alternatives
- timedatectl [options] [command]
- Example
- timeout [options] time span command
- Example
- tldr command
- top [q]
- Alternatives
- touch [options] files
- Example
- tr [options] zk1 [zk2] [ < source > target]
- Example
- traceroute[6] [options] target address
- Example
- trap [command] signal
- Example
- tree [options] [start directory]
- truncate [options] files
- Example
- tty
- tune2fs [options] device
- Example
- type command
- Example
- ubuntusecuritystatus [options]
- ufw [options] command
- Example
- ulimit option limit
- umask [mask]
- Examples
- umount deviceumount directory
- unalias abbreviation
- uname [options]
- Example
- uncompress file
- unexpand text file > result
- uniq [options] file
- Example
- unset variable
- until condition; do commandsdone
- Example
- unxz [options] files
- unzip [options] archive.zip [file1 file2]
- Example
- updatealternatives [options] command
- Example
- updategrub
- updateinitramfs [options]
- Example
- updatedb
- uptime [options]
- Example
- useradd [options] name
- Example
- userdel name
- usermod [options] name
- Example
- vcgencmd command
- Example
- vgchange [options] [vgname]
- vgcreate [options] vgname pvname1 [pvname2 ...]
- Example
- vgdisplay vgname
- vgextend vgname pvname
- Example
- vgmerge vgname1 vgname2
- vgreduce [options] vgname [pvname1 pvname2 ...]
- vgrename oldvgname newvgname
- vgscan
- vipw [options]vigr [options]visudo [options]
- virsh [[c connection] command]
- Examples
- virtclone [options]
- Example
- virtinstall [options]
- Example
- virttop [options]
- Example
- virtviewer [options] name/id/uuid
- wait [process number]
- Example
- wakeonlan [options] mac
- watch command
- Example
- wc files
- Example
- wget [options] url1 url2 . . .
- Recursive Downloads
- Examples
- whatis file
- whereis file
- which command
- Example
- while condition; do commandsdone
- Examples
- who [options]
- Example
- whois [options] host name
- Example
- wlcopy [options] textwlpaste
- wlr-randr [options]
- Example
- wol [options] mac
- wpa_passphrase ssid
- Example
- write username
- wsl [options] [command]
- Examples
- xargs command
- Example
- xdgopen file
- xdpyinfo [options]
- Example
- xfs_admin [options] device/imagefile
- xfs_growfs [options] mountdirectory
- xfs_info device
- xfs_repair [options] device/imagefile
- xhost +/hostname
- Example
- xinput [command]
- xkill [options]
- xrandr [options]
- Example
- xset [command]
- xz [options] files
- yay [options]
- yum [options] command
- z directory1 [directory2]
- zcat file.gzzless file.gzzmore file.gz
- zenity [options]
- Example
- zip [options] archive.zip file1 file2 ...
- Example
- zipinfo [options] file.zip
- zramctl [options] command
- Example
- zypper [options] command
- Example
- #&%! (Special bash Characters)
- Configuration Files
- /etc/adduser.conf
- /etc/aliases
- /etc/bashrc
- /boot/firmware/config.txt
- /etc/crontab
- /etc/deluser.conf
- /etc/dnf/dnf.conf
- /etc/fstab
- /etc/group
- /etc/default/grub
- /boot/grub/grub.cfg
- /etc/gshadow
- /etc/host.conf
- /etc/hostname
- /etc/hosts
- /etc/network/interfaces
- /etc/systemd/journald.conf
- /etc/locale.conf
- /etc/login.defs
- /etc/mailname
- /etc/mdadm/mdadm.conf
- /etc/modules
- /etc/netplan/netplan.yaml
- /etc/systemd/network/networkd.network
- /etc/NetworkManager/system-connections/<interface>.nmconnection
- /etc/nsswitch.conf
- /etc/os-release
- /etc/passwd
- /etc/profile
- /etc/rc.local/etc/rc.d/rc.local/etc/init.d/boot.local
- /etc/resolv.conf
- /etc/rsyslog.conf
- /etc/services
- /etc/shadow
- /etc/apt/sources.list
- /etc/sudoers
- /etc/sysctl.conf
- systemd.service
- systemd.timer
- /etc/vconsole.conf
- /etc/wpa_supplicant/wpa_supplicant.conf
- Keyboard Shortcuts
- bash
- emacs
- gnome-terminal
- grub
- info
- joe
- konsole
- less
- man
- mutt
- nano
- screen
- Text console
- vi/vim
Disclaimer
SAP, other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. Our Company is not affiliated to SAP SE or any of its affiliated companies including but not limited to: Sybase, Business Objects, Hybris, Ariba and SuccessFactors. All other names, brands, logos, etc. are registered trade or service marks of their respective owners.