Table of Contents

Open all
Close all
Overview of Commands Sorted by Topic
7
Managing Files
7
Finding Files
7
Compressing and Archiving Files
8
Processing Text Files
8
Access Control Lists (ACLs) and Extended Attributes (EAs)
9
Converters
9
Managing Processes
10
Managing Users and Groups
11
Administrating the File System
12
Logical Volume Manager (LVM)
13
SELinux and AppArmor
13
Package Management
14
Network Administration
14
Hacking and Security
16
Printer, Database, and Server Administration
16
Audio Functions and Hardware Management
17
Bluetooth
18
Kernel
18
System Start and Stop, init System, Logging, and GRUB
18
Virtualization, Containers, Cloud
19
Terminal and Text Console
19
Online Help
19
Graphics System and Gnome
19
Miscellaneous
20
“bash” Programming
21
“bash” Variable Management
21
Additional “bash” Commands and Special Characters
22
Configuration Files
22
Keyboard Shortcuts
23
Introduction
25
Commands from A to Z
27
aacomplain program
27
Example
27
aadisable program
27
aaenforce program
27
aastatus [option]
27
Example
28
ack [options] search term
28
Example
28
acme.sh [options]
29
Example
30
Alternatives
31
acpi [options]
31
addaptrepository ppa:name
31
Example
31
addgroup [options] name
32
adduser [options] nameadduser name group
32
Example
32
alias abbreviation=command
33
Example
33
alien [options] package file
33
alsactl [options] [command] [card/id/device]
33
alsamixer [options]
34
alternatives [options] command
35
amixer [options] [command]
35
Example
36
apk command
36
Example
37
apropos topic
37
Example
37
apt command
38
Example
39
aptcache command
39
Examples
40
aptfile [options]
40
Example
41
aptget [options] command
41
Example
42
aptkey command
42
aptitude [options] [command]
43
aptitude search
43
Examples
43
arp [options] [hosts/ipaddresses/network]
44
arpscan [options] [hosts/ipadresses/network]
45
Example
45
at [options] time
46
Time Specification
46
Options
46
Example
47
atq
47
atrm n
48
attr [options] files
48
awk [options] 'code' text filesawk [options] f code file text files
48
Examples
49
aws [options] main command [subcommand] [parameter]
49
Installation and Commissioning
50
Syntax and Online Help
51
S3 Administration
51
EC2 Administration
52
Example
52
badblocks device
52
basename string [ending]
53
Example
53
bat text file
53
batch
53
Example
54
bc [file]
54
Examples
54
Alternatives
54
bg [process]
54
blkid [options] [device]
55
Examples
55
bluetoothctl
55
Example
57
boltctl command
57
break [n]
58
btrfs command
58
Example
60
Documentation
61
bunzip2 file.bz2
61
bzip2 file
61
Example
62
cadaver [options] [files]
62
Example
62
canonicallivepatch [command]
62
Example
63
case expression in pattern1 ) commands;; pattern2 ) commands;; ... esac
63
Example
63
cat [options] [files]
64
Examples
64
Variants
65
cd [directory]
65
cfdisk [options] device
65
chacl [options] files
65
chage [options] loginname
65
Examples
66
chattr [options] +=[aAcCdDeijsStTu] files
67
Example
67
chcon [options] context fileschcon [options] reference=reference file fileschcon [options] [u user] [r role] [t type] [l level] files
68
Examples
69
chgrp [options] group files
69
Example
69
chkrootkit [options]
69
Example
70
Variants
70
chmod [options] changes files
70
setuid, setgid, and sticky Bits
70
Octal Notation
71
Options
71
Examples
71
chown [options] user[:group] files
72
Example
72
chpasswd [options]
72
Example
72
chroot directory [command]
73
Example
73
chsh s shell [user]
74
Example
74
chvt n
74
cksum file
74
clear
74
cmp [options] file1 file2
75
cnf command
75
Example
75
column [options] file
75
compress [options] file
76
continue [n]
76
convert or magick [options] image old image new
76
Examples
77
cp [optionen] source targetcp [options] files target directory
78
Copying Directories
79
Examples
79
cpio command [options]
80
Example
80
crontab [options]
80
cryptsetup [options] command
81
Example
82
csplit [options] file splitting position
82
Specification of the Splitting Positions
83
Options
83
Example
83
curl [options] [url]
84
Examples
85
Alternatives
85
cut [options] file
85
Example
86
date [options] [+format]
86
Examples
87
dconf command
87
Examples
88
dd options
88
Examples
89
Alternatives
89
declare [options] var[=value]
90
delgroup [options] name
90
delta [options] file1 file2
90
deluser [options] name deluser name group
91
depmod [options]
91
df [options] [directory]
91
Example
92
Alternatives
92
dhclient interface
93
Example
93
diff [options] file1 file2
93
Example
94
Alternatives
94
dig [options] [@dnsserver] host/ipaddr [type]
94
Example
95
dircolors [optionen] [file]
95
Example
95
dirname string
96
dirs
96
disown [options] [jobspec]
96
Example
96
dmesg [options]
97
dnf [options] command
97
Examples
100
docker [options] command
101
Example
103
dpkg options [filename/packagename]
104
Example
105
dracut [options] initrd file kernel version
106
Example
106
du [options] [directory]
106
Example
107
Alternatives
107
dumpe2fs device
107
dvips [options] name.dvi
108
e4defrag [options] file/directory/device
108
echo [options] string
109
Example
109
efibootmgr [options]
109
Example
110
egrep [options] search pattern file
111
enscript [options] source file p target file
111
epstopdf [options] file.eps
112
erd [options] files
112
etherwake [options] mac
113
Example
113
ethtool [options] device [parameter]
114
Example
114
eval $var
114
Example
114
exec command
115
exfatlabel device [label]
115
exiftool [options] file/directory
115
Example
115
exit [return value]
116
expand [options] file
116
Example
116
export [options] variable [=value]
116
exportfs [options]
117
expr expressionexpr string : pattern
117
Examples
117
fail2banclient [options] command
117
Examples
118
fclist [pattern]
118
fdisk [options] [device]
119
ffmpeg [inopts] [i infile] [outopts] outfile
119
Example
120
fg [process]
120
fgconsole [nextavailable]
120
file [options] file
120
Example
120
find [path] [search options]
121
General Options
121
Search Criteria
121
Actions When Finding a File
123
Examples
124
Alternatives
125
findmnt [options] [device/mountpoint]
125
Example
126
firewallcmd options
126
Options
127
Examples
129
flatpak [options] command
129
Examples
130
fold [options] file
131
for var [in list;] do commandsdone
132
Example
132
free [options]
132
Example
132
fsck [options] device
133
fsck.ext2 [options] devicefsck.ext3 [options] devicefsck.ext4 [options] device
133
fstrim [options] mount directory
134
Example
134
ftp [options] ftpserver
134
[function] name {{commands}
135
Example
136
fuser file name
136
Example
137
fwupdmgr command
137
Example
137
fx file.json
138
fzf [options]
139
getcap [options] file name
139
Example
139
getenforce
140
getfacl [options] file name
140
getfattr [options] file name
140
getopts "format"
141
Example
141
Alternatives
142
git command [options/parameters]
142
Commands
142
Revision Syntax
147
Examples
148
glances [options]
148
gnomesessionquit [options]
149
gpasswd [options] group
150
gpg or gpg2 [options/commands]
150
Examples
152
gpioget [options] chipnr gpio1 gpio2 ...gpioset [options] chipnr gpio1=status1 gpio2=status2 ...
153
Alternatives
154
grep [options] search pattern filegrep R [options] search pattern
154
Examples
157
Variants of grep
158
grim [options] filename.png
158
Examples
159
groupadd name
159
groupdel name
159
groupmod [options] name
159
Example
159
groups [username]
160
Example
160
grubinstall [device]grub2install [device]
160
Example
160
grubmkconfig [options]grub2mkconfig [options]
161
gsettings command
161
Example
161
gunzip file
161
gzip [options] file
162
Examples
162
halt [options]
162
hash [option]
163
hciconfig [hcidevice] [command]
163
hcitool [options] [command]
163
Commands
163
Example
164
head [options] file
164
Alternatives
164
help name
165
history [options] [n]
165
host [options] name/ipaddress
165
Example
165
hostname [name]
166
hostnamectl [options] [command]
166
Example
167
htop [options]
167
htpasswd [options] password file username [password]
167
Example
168
hwclock [options]
168
hydra [options] [hostname/ipaddress] service
168
Example
170
Alternatives
170
iconv f charset1 t charset2 in.txt > out.txt
170
id
170
Example
171
if condition; then commands[elif condition; then commands][else commands]fi
171
ifconfig interface [options] [ipaddress]
171
iftop [options]
171
ifup interfaceifdown interface
172
Example
172
info [command name]
172
init [n]
172
inotifywait [options] [files/directories]
173
Example
173
insmod [options] module file [parameter=value ...]
174
install [options] source target
174
Example
175
inxi [options]
175
Example
176
ionice [options] [command]
176
Example
176
iotop
177
ip [options] object command
177
Example
178
ipcalc ipadress [netmask]
179
iptables [options]ip6tables [options]
180
iptables P chain policy [t table]
180
iptables A chain [t table] options
181
iptables N mychain
182
iptables L [chain] [t table] [v]
182
iptables D chain [t table] options
182
iptables F chain [t table]
183
iptables X [mychain]
183
Example
183
ip[6]tablessave [options]ip[6]tablesrestore [options]ip[6]tablesxml [options]
183
iw object command
184
Example
185
j directory
185
john [options] [hashfile]
185
Example
186
Alternatives
187
journalctl [options] [search expression]
188
Examples
189
jq [options] filter expression [file.json]
189
Examples
190
kbdrate [options]
190
kexec [options]
190
Example
191
kill [s signal] processno
191
killall [signal] process name
192
Example
192
kpartx [diskdevice]
192
Example
193
kvm [options] [imagefile]
193
l2ping [options] bluetoothmac
193
lame [options] in out.mp3
193
Example
194
last [options]
194
Example
194
lastb [options]
194
ldconfig
194
ldd program
195
Example
195
less [options] file
195
lftp [options] [site]
196
Example
196
libcamerastill [options]libcameravid [options]
196
ll [options] files
196
ln [options] source [target]ln [options] files target directory
197
Example
197
loadkeys [options] file name
197
Example
197
local var[=value]
198
localectl [options] [command]
198
Options
198
Commands
198
Example
199
locate pattern
199
logger [options] message
199
Example
199
loginctl [options] [command] [name]
200
Example
200
logname
201
logout
201
lpadmin [options]
201
lpinfo [options]
201
lpoptions [options]
202
lpq [options]
202
lpr file
202
lprm [options] [id]
203
lpstat [options]
203
ls [options] [path]
203
Example
205
Alternatives
205
lsattr [options] files
206
Example
206
lsblk [options] [iodevice]
206
Example
207
lsb_release [options]
207
Example
208
lscpu [options]
208
lshw [options]
208
Example
208
lsmod
209
lsof [options] [file/interface]
209
Examples
210
lspci [options]
210
lsscsi [options]
210
Example
211
lsusb [options]
211
Example
211
lvcreate [options] name
211
Example
212
lvdisplay [options] lvname
212
lvextend [options] lvname [pvname]
212
lvm [command]
213
lvreduce [options] lvname
213
lvremove [options] lvname
213
lvrename oldlvname newlvname
213
lvscan [options]
213
lz4 [options] [filename]lzop [options] [filename]
214
Examples
214
magick [options] imageold imagenew
214
mail [options] mail@hostname [< message text]
215
Example
215
makepasswd [options]
216
Example
216
man [group] [options] name
216
md5sum files
217
mdadm [options]
217
Examples
218
mkdir directory
219
mkfifo file
219
Example
219
mkfs [options] device [blocks]
220
mkfs.btrfs [options] device1 [device2 device3 ...]
220
Example
221
mkfs.exfat [options] device
221
mkfs.ext2 [options] device [blocks]mkfs.ext3 [options] device [blocks]mkfs.ext4 [options] device [blocks]mke2fs [options] device [blocks]
222
Example
223
mkfs.ntfs [options] device
223
mkfs.vfat [options] device
223
Example
223
mkfs.xfs [options] device
224
mknod devicefile [b|c] major minor
224
mkpasswd [options]
224
Example
225
mkswap device/file
225
Example
225
modinfo module name
225
modprobe [options] module name [parameter=value ...]
225
mogrify [options] image file
226
Example
226
more file
226
mountmount [options] device directory
226
General mount Options
227
General File System Options
227
btrfs Options
230
CIFS Options
231
exFAT Options
233
ext3/ext4 Options
233
ext3/ext4 Journaling Modes
234
NFS Options
235
NTFS Options
236
VFAT Options
236
XFS Options
238
Examples
238
mtr [options] host name
239
Example
240
multitail [options] file1 [file2 file3 ...]
240
mv source targetmv files target directory
240
Example
241
mysql [options] [database name] [ < name.sql]
241
Example
243
Alternatives
243
mysqladmin [options] command1 command2 ...
243
Example
245
mysqlbinlog [options] loggingfile1 file2 ...
245
Example
245
mysqldump [options] dbname [table1 table2 ...]mysqldump [options] databases [dbname1 dbname2 ...]mysqldump [options] alldatabases
245
Examples
247
namei [options] file
248
nc [options] [hostname/ipaddress] [port]
248
Examples
249
ncdu [options] [directory]
250
Example
250
needsrestarting [options]
250
Example
251
netplan [command]
251
netstat [options]
251
Example
252
networkctl [command]
252
Examples
253
newaliases
254
newgrp [group name]
254
Example
254
newusers file
254
Example
255
nft command [options]
255
nft Terminology
255
nft Options
256
nft Commands
256
Examples
257
ngrep [options] [grepsearchexpression] [pcapfilterexpression]
259
Example
260
nice [options] program
260
Example
260
nl [options] file
260
nmap [options] hostname/ipaddress/ipaddressrange
260
Examples
262
nmblookup [options] workgroupname
263
Example
264
nmcli [options] con|dev|nm command
264
Examples
265
nohup command
265
Example
266
nproc
266
nvidiaxconfig [options]
266
openssl command
266
Examples
268
pacman [options]
270
Examples
270
Alternatives
271
pactl command [parameter]
271
Example
272
pandoc [options] in1 [in2 in3 ...] [> out]
272
Examples
273
paplay [options] [file]parecord [options] [file]
273
Example
273
paps [options] text files > out.ps
274
Example
274
parallel [options] ['command']
274
Examples
275
parted [options] [device [command [options]]]
275
Examples
277
partprobe [options] [devices]
278
partx [options] [partition] [disk]
279
Example
280
passwd [options] [username]
280
Example
281
paste file1 file2 . . .
281
patch [options] < patch file
281
Example
282
pdf2ps source.pdf [target.ps]
282
pdfimages [options] file.pdf [image name]
283
Example
283
pdftk file1.pdf file2.pdf . . . command
284
Examples
285
pdftops [options] source.pdf [target.ps]
285
pdftotext [options] source.pdf [target.txt]
286
pdfunite in1.pdf in2.pdf . . . out.pdf
286
pg_dump [options] [> backup.sql]
286
Example
287
pidof program name
287
Example
287
pinctrl command
287
Example
288
ping [options] addressping6 [options] address
289
pip or pip3 command
289
Example
290
pkcon command
290
popd
291
postconf [options] [parameter[=value]]
291
postqueue [options]
292
powertop
292
ppapurge ppa:ppaowner[/ppaname]
293
Example
293
printenv [variable]
293
printf format para1 para2 para3 ...
293
Example
293
pro command
293
Example
294
ps [options]
294
Examples
295
ps2pdf [options] source.ps [target.pdf]
296
Example
296
psql [options]
296
Example
297
pssh [options] commandpscp [options] local_file remote_filepnuke [options] pattern
297
Example
298
pstree [options] [pid]
298
pushd directory
298
pvcreate [options] device
298
Example
299
pvdisplay device
299
pvremove device
299
pvscan
299
pwcat audio filepwcli [command]pwmon [options]pwtop [options]
299
pwd
300
Example
300
pwgen [options] [n]
300
Example
301
qalc [expression]
301
qemu [options] [imagefile]
302
Example
306
qemuimg command
306
Examples
307
rclone command
307
Example
308
rdfind [options] directory1 directory2
308
Examples
309
rdiffbackup [options] source directory target directory
310
Examples
311
read [var1 var2 var3 ...]
311
readonly
311
reboot [options]
311
recode character set1..character set2 filerecode character set1..character set2 < source > target
311
Examples
312
rename
312
rename on Debian, Raspberry Pi OS, and Ubuntu
312
rename on Fedora, RHEL, and SUSE
313
renice n pid
313
reset
313
resize2fs [options] device [size]
313
Example
314
resolvectl [options] command [name]
314
Example
315
restorecon [options] files
315
Example
316
rfkill command
316
Example
316
rkhunter [options]
317
Example
317
rm [options] files
318
Examples
318
rpicamstill [options]
318
Example
319
Variants
320
rpicamvid [options]
320
Example
320
rmdir [options] directory
320
rmmod [options] module name
321
route [options]route add/del [net/host] target address [options]
321
Example
321
rpcinfo [options]
322
rpm options [filename/package name]
322
Examples
324
rpm2archive name.rpmrpm2cpio name.rpm
324
rsync [options] sourcersync [options] source target
324
Examples
326
scp [options] source target
327
Examples
327
screen [options] [ttydevice]
328
Example
328
scrot [options]
328
Example
329
sdptool [options] command
329
Example
329
sealert [options]
330
sed [options] command [< source > target]
331
Example
331
seq [options] endseq [options] start endseq [options] start delta end
332
Examples
332
sestatus [options]
332
Example
333
set
333
setcap [options] capability file name
333
Example
334
setenforce 0|1|Enforcing|Permissive
334
setfacl [options] [aclaction] file name
334
Examples
336
setfattr [options] file name
337
Examples
337
setsebool [options] bool1=value1 bool2=value2 ...
338
Example
338
setterm [option]
338
Example
339
sfdisk [options]
339
Example
340
sftp [options] sshserversftp [optionen] user@sshserver:filename
340
sgdisk [option] device
340
Example
341
shansum files
341
Example
342
shift [n]
342
showmount [options]
342
Example
342
shutdown [options] time [message]
342
sleep time
343
slurp
343
smartctl options device
344
Example
344
smbclient [options]smbclient directory [password] [options]
345
Example
346
smbpasswd [options] [name]
346
smbstatus [options]
346
snap [options] command
347
Example
347
snapper [options] command
347
sort [options] file
348
Example
349
source file
349
speakertest [options]
349
Example
350
split [options] file [target file]
350
Example
350
sqlite3 [options] database filesqlite3 [options] database file "sqlcommand1;sql2;..."
351
Example
351
ss [options]
351
Example
352
ssh [options] computer namessh [options] computer name command
352
Examples
353
sshcopyid [options] user@host
354
sshkeygen [options]
355
Example
355
stat [options] files
356
Example
356
strace [options] command
357
strings [options] file
357
Examples
357
su [options] [user]
357
sudo [options] [var1=value1 var2=value2] command
358
Examples
359
Example with Input/Output Redirection
359
swaks [options]
359
swapon [options] deviceswapoff device
360
sync
360
sysctl options
361
Example
361
systemctl command
361
Examples
362
systemdanalyze command
363
tac file
363
tail [options] file
363
Example
364
tar action [options] filestar action [options] directories
364
Actions
365
Options
365
Examples
366
tasksel
367
Example
368
tcpdump [options] [filter expression]
368
Options
368
Filter Expression
368
Examples
369
tee file
370
Example
370
telnet [options] host [port]
370
Example
370
test expression
371
Character Strings
371
Numbers
371
Files (Excerpts)
372
Linked Conditions
372
bash Variant [[ expression ]]
372
Example
373
time command
373
Example
374
Alternatives
374
timedatectl [options] [command]
374
Example
375
timeout [options] time span command
375
Example
375
tldr command
375
top [q]
376
Alternatives
376
touch [options] files
376
Example
377
tr [options] zk1 [zk2] [ < source > target]
377
Example
377
traceroute[6] [options] target address
377
Example
378
trap [command] signal
378
Example
378
tree [options] [start directory]
379
truncate [options] files
379
Example
379
tty
380
tune2fs [options] device
380
Example
380
type command
380
Example
381
ubuntusecuritystatus [options]
381
ufw [options] command
381
Example
382
ulimit option limit
382
umask [mask]
383
Examples
383
umount deviceumount directory
383
unalias abbreviation
384
uname [options]
384
Example
384
uncompress file
384
unexpand text file > result
384
uniq [options] file
385
Example
385
unset variable
385
until condition; do commandsdone
385
Example
385
unxz [options] files
386
unzip [options] archive.zip [file1 file2]
386
Example
386
updatealternatives [options] command
386
Example
387
updategrub
387
updateinitramfs [options]
387
Example
388
updatedb
388
uptime [options]
388
Example
388
useradd [options] name
389
Example
389
userdel name
389
usermod [options] name
390
Example
390
vcgencmd command
390
Example
391
vgchange [options] [vgname]
391
vgcreate [options] vgname pvname1 [pvname2 ...]
391
Example
391
vgdisplay vgname
392
vgextend vgname pvname
392
Example
392
vgmerge vgname1 vgname2
392
vgreduce [options] vgname [pvname1 pvname2 ...]
392
vgrename oldvgname newvgname
392
vgscan
393
vipw [options]vigr [options]visudo [options]
393
virsh [[c connection] command]
393
Examples
398
virtclone [options]
399
Example
399
virtinstall [options]
400
Example
401
virttop [options]
402
Example
402
virtviewer [options] name/id/uuid
402
wait [process number]
403
Example
403
wakeonlan [options] mac
403
watch command
403
Example
404
wc files
404
Example
404
wget [options] url1 url2 . . .
404
Recursive Downloads
405
Examples
406
whatis file
406
whereis file
407
which command
407
Example
407
while condition; do commandsdone
407
Examples
407
who [options]
408
Example
408
whois [options] host name
408
Example
409
wlcopy [options] textwlpaste
409
wlr-randr [options]
409
Example
409
wol [options] mac
409
wpa_passphrase ssid
410
Example
410
write username
410
wsl [options] [command]
410
Examples
411
xargs command
412
Example
412
xdgopen file
413
xdpyinfo [options]
413
Example
413
xfs_admin [options] device/imagefile
413
xfs_growfs [options] mountdirectory
414
xfs_info device
414
xfs_repair [options] device/imagefile
414
xhost +/hostname
415
Example
415
xinput [command]
415
xkill [options]
415
xrandr [options]
416
Example
417
xset [command]
417
xz [options] files
417
yay [options]
418
yum [options] command
418
z directory1 [directory2]
418
zcat file.gzzless file.gzzmore file.gz
419
zenity [options]
419
Example
420
zip [options] archive.zip file1 file2 ...
420
Example
420
zipinfo [options] file.zip
420
zramctl [options] command
420
Example
421
zypper [options] command
421
Example
423
#&%! (Special bash Characters)
425
Configuration Files
427
/etc/adduser.conf
427
/etc/aliases
429
/etc/bashrc
430
/boot/firmware/config.txt
430
/etc/crontab
431
/etc/deluser.conf
434
/etc/dnf/dnf.conf
435
/etc/fstab
437
/etc/group
438
/etc/default/grub
439
/boot/grub/grub.cfg
441
/etc/gshadow
441
/etc/host.conf
442
/etc/hostname
443
/etc/hosts
443
/etc/network/interfaces
444
/etc/systemd/journald.conf
447
/etc/locale.conf
448
/etc/login.defs
449
/etc/mailname
451
/etc/mdadm/mdadm.conf
451
/etc/modules
452
/etc/netplan/netplan.yaml
452
/etc/systemd/network/networkd.network
454
/etc/NetworkManager/system-connections/<interface>.nmconnection
455
/etc/nsswitch.conf
457
/etc/os-release
458
/etc/passwd
459
/etc/profile
460
/etc/rc.local/etc/rc.d/rc.local/etc/init.d/boot.local
460
/etc/resolv.conf
461
/etc/rsyslog.conf
462
/etc/services
464
/etc/shadow
465
/etc/apt/sources.list
466
/etc/sudoers
467
/etc/sysctl.conf
469
systemd.service
470
systemd.timer
473
/etc/vconsole.conf
475
/etc/wpa_supplicant/wpa_supplicant.conf
475
Keyboard Shortcuts
477
bash
477
emacs
477
gnome-terminal
480
grub
480
info
481
joe
482
konsole
482
less
483
man
483
mutt
484
nano
484
screen
485
Text console
485
vi/vim
486
The Author
491