101 exam Flashcards

1
Q

Shows the kernel version (release)

A

uname -r

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Displays the system architechture

A

uname -m

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Displays all information that uname can output

A

uname -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Shows details about the CPU

A

lscpu

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Shows the running kernel modules

A

lsmod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Displays detailed information about a kernel module

A

modinfo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Shows the author of a kernel module

A

modinfo -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Shows a brief description of the kernel module

A

modinfo -d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Shows the license under which the kernel module is located

A

modinfo -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Loads a kernel module into the kernel

A

modprobe

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Unloads a kernel module from the kernel

A

modprobe -r

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Unloads a kernel module from the kernel (out of date!)

A

rmmod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Loads a kernel module into the kernel (outdated)

A

insmod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Lists all PCI devices

A

lspci

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Lists all PCI devices in more detailed view

A

lspci -v

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Lists all PCI devices in an even more detailed view

A

lspci -vv / lspci -vvv

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Lists all PCI devices, including the modules they use

A

lspci -k

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Lists all USB devices

A

lsusb

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Lists all USB devices in more detailed view

A

lsusb -v

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Lists only the USB devices on bus 002

A

lsusb -s 002

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Only shows the USB devices of the respective manufacturer

A

lsusb -d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Displays the USB devices in a tree view

A

lsusb -t

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Shows running processes in a tree view

A

pstree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Shows running processes including the process ID in a tree view

A

pstree -p

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Reads the kernel ring buffer (kernel boot logs)

A

dmesg

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Displays all systemd logs

A

journalctl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Displays all systemd logs related to the kernel

A

journalctl -k

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Shows the services that are started automatically, including runlevel (init)

A

chkconfig –list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Starts a process (on SysVinit systems)

A

service -process- start

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Stops a process (on SysVinit systems)

A

service -process- stop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Shows the status of a process (on SysVinit systems)

A

service -process- status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Shows a list of all init services + their status

A

initctl list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Starts a process (on upstart systems)

A

initctl start -process-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Stops a process (on upstart systems)

A

initctl stop -process-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Shows the status of a process (on upstart systems)

A

initctl status -process-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

Starts a process (on systemd systems)

A

systemctl start -process-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

Stops a process (on systemd systems)

A

systemctl stop -process-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

Shows the status of a process (on systemd systems)

A

systemctl status -process-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Lists all systemd units of the system including status

A

systemctl list-units

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

Restarts a process (on systemd systems)

A

systemctl restart -process-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

Shows in which runlevel you are currently and before

A

runlevel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

Changes to runlevel 3

A

init 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

Changes to runlevel 3

A

telinit 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

Changes to the boot target Multi-User.Target (systemd)

A

systemctl isolate multi-user.target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

Displays the set standard boot target

A

systemctl get-default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

Sets the standard boot target to Multi-User.Target

A

systemctl set-default multi-user.target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

Restarts the system

A

systemctl isolate reboot.target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

Turns off the system

A

systemctl isolate poweroff.target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

Restarts the system in 10 minutes

A

shutdown -r +10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

Deletes the previously set waiting time and thus the entire command

A

shutdown -c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

Immediately restart the system

A

shutdown -r now

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

Shuts down the system immediately

A

shutdown -h now

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

Shuts down the system

A

halt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

Shuts down the system

A

poweroff

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

Reboots the system

A

reboot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

Sends a message through the system to logged-in users

A

wall -message-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

Displays the swap partitions or files in use

A

swapon -s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

All swap files or swap partitions will be stopped

A

swapoff -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

Any swap files or partitions will start

A

swapon -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

Lists all block devices (hard disks)

A

lsblk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q

Lists all hard disks including storage space and mount point

A

df

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

Displays the UUID of a hard drive

A

blkid

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
63
Q

Shows all mounts of the system

A

mount

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
64
Q

Displays the physical volume (PV) (with installed LVM)

A

pvs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
65
Q

Displays the volume groups (VG) (if LVM is installed)

A

vgs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
66
Q

Displays the logical volumes (LV) (if LVM is installed)

A

lvs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
67
Q

Installs GRUB Legacy in the corresponding GRUB partiiton

A

grub-install -grub partition-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
68
Q

Opens a GRUB shell (legacy)

A

grub

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
69
Q

Creates a new grub.cfg file (GRUB 2). To do this, manual Changes have been made in the /etc/default/grub file

A

grub-mkconfig / grub2-mkconfig

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
70
Q

Same function as grub-mkconfig, but only on debian systems available

A

update-grub

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
71
Q

Shows which libraries the respective program uses

A

ldd /path/program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
72
Q

Makes new libraries known system-wide

A

ldconfig

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
73
Q

Variable in which a library path can be stored

A

LD_LIBRARY_PATH

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
74
Q

Installs the program -program.deb-

A

dpkg -i -program.deb-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
75
Q

Configures the program -program- (usually not necessary because this happens automatically during installation) ..dpkg..

A

dpkg –configure -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
76
Q

Completely reconfigures -program- ..dpkg..

A

dpkg-reconfigure -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
77
Q

Shows in which paths the program would be installed ..dpkg..

A

dpkg -L -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
78
Q

Shows a list of all installed packages on the system ..dpkg..

A

dpkg -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
79
Q

Removes -program- from the system. Configuration files are retained! ..dpkg..

A

dpkg -r -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
80
Q

Removes -program- including configuration files ..dpkg..

A

dpkg -P -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
81
Q

Removes -program- including configuration files ..dpkg..

A

dpkg –purge -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
82
Q

Installs the -program.deb- downloaded in the current directory, including the corresponding dependencies ..apt..

A

apt install ./-program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
83
Q

Removes -program- including all config files and dependencies, provided they are not used by other programs ..apt..

A

apt purge -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
84
Q

Updates the package sources from /etc/apt/sources.list

A

apt update

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
85
Q

Updates the entire Linux system to the latest state ..apt..

A

apt dist-upgrade

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
86
Q

Updates the system but does not delete any files. So refuses Service when a file should be deleted ..apt..

A

apt upgrade

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
87
Q

Updates the system and also deletes files if necessary ..apt..

A

apt full-upgrade

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
88
Q

Deletes files that are no longer needed due to a system update ..apt..

A

apt autoremove

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
89
Q

Searches for -program- in the apt cache

A

apt-cache search -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
90
Q

Outputs the dependencies of -program- (before the installation) ..apt..

A

apt-cache depends -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
91
Q

Installed -program- with aptitude

A

aptitude install -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
92
Q

Removes -program- from the system. Configuration files are retained. ..aptitude..

A

aptitude remove -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
93
Q

Removes -program- including config files from the system ..aptitude..

A

aptitude purge -progaram-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
94
Q

Searches for the package -program- in the aptitude cache

A

aptitude search -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
95
Q

Starts the graphical user interface of aptitude

A

aptitude

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
96
Q

Shows in which paths the program would be installed ..rpm..

A

rpm -qpl -program.rpm-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
97
Q

Displays detailed information on -program.rpm-

A

rpm -qpi -program.rpm-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
98
Q

Installs -program.rpm- on the system (dependencies are not resolved independently!)

A

rpm -i -program.rpm-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
99
Q

Displays all programs installed on the system ..rpm..

A

rpm -qa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
100
Q

Removes -program- from the system (e = erase) ..rpm..

A

rpm -e -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
101
Q

Updates -program.rpm- to a newer version

A

rpm -U -program.rpm-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
102
Q

Shows from which package /path/program originated ..rpm..

A

rpm -qf /path/program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
103
Q

Updates the entire system to the latest version (Red Hat systems) ..yum..

A

yum update

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
104
Q

Searches for -program- in the package sources ..yum..

A

yum search -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
105
Q

Provides detailed information on -package name- ..yum..

A

yum info -package name-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
106
Q

Installed -program- including all dependencies ..yum..

A

yum install -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
107
Q

Displays all program installed on the system ..yum..

A

yum list installed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
108
Q

Removes -program- from the system ..yum..

A

yum remove -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
109
Q

Deletes files that are no longer needed due to a system update ..yum..

A

yum autoremove

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
110
Q

Shows, among other things, which package -program- originally came from ..yum..

A

yum whatprovides -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
111
Q

Downloads -program- without installing it at the same time ..yum..

A

yumdownloader -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
112
Q

Searches for -program- in the package sources (SUSE systems) ..zypper..

A

zypper se -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
113
Q

Installes -program- including all dependencies (SUSE systems) ..zypper..

A

zypper install -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
114
Q

Removes -program- from the system ..zypper..

A

zypper remove -program-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
115
Q

Displays the updates available for the system ..zypper..

A

zypper list-updates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
116
Q

Updates the system to the current status ..zypper..

A

zypper update

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
117
Q

Shows the configured package sources from zypper ..zypper..

A

zypper repos

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
118
Q

Displays man page 2 of -command-

A

man 2 -command-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
119
Q

Displays a history of the most recently entered commands

A

history

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
120
Q

Variable that contains the file in which the history is saved

A

HISTFILE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
121
Q

File in which the history is saved

A

~/.bash_history

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
122
Q

Outputs the content of the HISTFILE variable

A

echo $HISTFILE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
123
Q

Activates the possibility to output line breaks (\ n) or TAB (\ t), for example

A

echo -e

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
124
Q

Shows the environment variables including their values in bash

A

env

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
125
Q

Shows further variables of the shell + different functions

A

set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
126
Q

Switches on the debug mode of the shell

A

set -x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
127
Q

Switches off the debug mode of the shell

A

set +x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
128
Q

Deletes a variable

A

unset VARIABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
129
Q

Starts another bash in which we are located automatically (child process)

A

bash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
130
Q

Creates a variable that can also be used in child processes

A

export VARIABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
131
Q

Copies the contents of file1 and file2 to file 3

A

cat file1 file2 > file3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
132
Q

Outputs the content of file1 page by page

A

less file1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
133
Q

Displays the first 10 lines of -file-

A

head -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
134
Q

Displays the first 20 lines of -file-

A

head -n 20 -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
135
Q

Displays the last 10 lines of -file-

A

tail -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
136
Q

Displays the last 20 line of -file-

A

tail -n 20 -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
137
Q

Displays the last lines of -file- in real time

A

tail -f

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
138
Q

Outputs the content of a gz-compressed file

A

zcat -file.gz-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
139
Q

Outputs the content of a bz2-compressed file

A

bzcat -file.bz2-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
140
Q

Outputs the content of a xz-compressed file

A

xzcat -file.xz-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
141
Q

Opens the text file with line numbers (only non-blank lines)

A

nl -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
142
Q

Empty lines are also given a line number

A

nl -ba -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
143
Q

Shows the number of lines and words in a document

A

wc -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
144
Q

Only shows the number of words

A

wc -w -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
145
Q

Only shows the number of lines

A

wc -l -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
146
Q

Creates a dump of -file- in octal notation

A

od -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
147
Q

Creates a dump of -file- in “normal” notation

A

od -c -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
148
Q

Creates a dump of -file- in binary notation

A

od -b -file-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
149
Q

Creates a dump of -file- in hexadecimal notation

A

od -h -file-

150
Q

Creates a dump of -file- in ASCII notation

A

od -a -file-

151
Q

Displays the hash value of -file-

A

md5sum -file-

152
Q

Compares the saved hash value from -file- with the hash value of the Program and outputs a corresponding message

A

md5sum -c -file.md5-

153
Q

Displays the hash value of -file- ..sha..

A

sha256sum -file- , sha512sum -file

154
Q

Sorts -table.csv- based on the first number

A

sort -table.csv-

155
Q

Sorts -table.csv- based on the whole number

A

sort -n -table.csv-

156
Q

Sorts -table.csv- based on the data in the third column

A

sort -t “,” -k3 -table.csv-

157
Q

Deletes identical lines from -file.txt- that are directly below each other

A

uniq -file.txt-

158
Q

Deletes identical lines from -file.txt- that are directly below each other and at the same time shows how often these lines occurred

A

uniq -c -file.txt-

159
Q

Groups identical lines from -file.txt-

A

uniq –group -file.txt-

160
Q

Replaces the commas in table.csv with semicolons

A

cat table.csv | tr ‘,’ ‘;’

161
Q

Removes the commas from table.csv

A

cat table.csv | tr -d ‘,’

162
Q

Replaces lower case letters in table.csv with upper case letters

A

cat table.csv | tr ‘a-z’ ‘A-Z’

163
Q

Outputs only the fourth column of table.csv

A

cut -d ‘,’ -f 4 table.csv

164
Q

Outputs columns 1,2 and 4 of table.csv

A

cut -d ‘,’ -f 1,2,4 table .csv

165
Q

Outputs the content of both files separated by a TAB (standard)

A

paste -file1- -file2-

166
Q

Outputs the content of both files separated by a semicolon

A

paste -d ‘,’ -file1- -file2-

167
Q

Outputs the content of both files line by line, separated by a colon

A

paste -d “,” -s -file1- -file2-

168
Q

Replaces the word “colleague” in table.csv with the word “employee”

A

sed ‘s/colleague/employee/g’ table.csv

169
Q

Replaces the word “colleague” in table.csv with the word “employee”. This is saved directly in table.csv.

A

sed -i ‘s/colleague/employee/g’ table.csv

170
Q

Creates several small files of 1000 bytes each from a large file

A

split -b 1000 -file-

171
Q

Shows the directory in which you are currently located

A

pwd

172
Q

Changes to /path/to/directory

A

cd /path/to/directory

173
Q

Changes back one directory in the directory tree

A

cd ..

174
Q

Changes to the personal home directory

A

cd ~

175
Q

Changes to the directory you were in before

A

cd -

176
Q

Copies -file- to /tmp

A

cp -file- /tmp

177
Q

Copies -fiel- to /tmp. If the file already exists there, we asked if we want to overwrite this

A

cp -i -file- /tmp

178
Q

Copies -file- to /tmp while keeping the time stamp of the source file

A

cp -p -file- /tmp

179
Q

Copies the directory /tmp including files and subdirectories into the Directory in which we area currently

A

cp -r /tmp .

180
Q

Moves -file- to the /tmp directory

A

mv -file- /tmp

181
Q

Renames file1 to file2

A

mv -file1- file2-

182
Q

Creates an empty file named “file” or changes the timestamp of an already existing file “file”

A

touch -file-

183
Q

Sets the timestamp of -file- to 04/012019 at 12:34 p.m. and 21 seconds

A

touch -t 201904011234.21 -file-

184
Q

Shows what kind of file it is (e.g. ASCII text tile)

A

file -file-

185
Q

Lists the contents of a directory

A

ls

186
Q

Lists the contents of a directory, including hidden files

A

ls -a

187
Q

Lists the contents of a directory in a detailed view

A

ls -l

188
Q

Lists the contents of a directory in a detailed view. The size of files is displayed in a readable format, e.g. 1 MB instead of 1000000 bytes

A

ls -lh

189
Q

Shows the content of a directory, including the subdirectories

A

ls -R

190
Q

Sorts the output according to the files last edited. The last edited file is at the bottom

A

ls -ltr

191
Q

Creates a directory called “test”

A

mkdir test

192
Q

Creates three directories “test1-3”

A

mkdir test1 test2 test3

193
Q

Creates the directory “test4” and the subdirectory “test5” and its subdirectory “test6”

A

mkdir -p test4/test5/test6

194
Q

Deletes (empty) directory

A

rmdir -directory-

195
Q

Deletes -directory 1- and its sub-folder -directory 2-

A

rmdir -p -directory1/directory2-

196
Q

Deletes -file-

A

rm -file-

197
Q

Before deleting, asks whether we are really sure

A

rm -i -file-

198
Q

Deletes -file- and then issues a success message

A

rm -v -file-

199
Q

Deletes -directory- including subfolders and files

A

rm -rf ./-directory-

200
Q

Searches (and finds, if available) -filename-

A

find -name -file-

201
Q

Looks for files with the extension .log in the /var directory

A

find /var -name *.log

202
Q

Creates an exact image from /dev/sda1 to /dev/sdb1

A

dd if=/dev/sda1 of=/dev/sdb1

203
Q

Searches in / for log files, but only with a maximum of 4 subdirectories

A

find / -maxdepth 4 -name *.log

204
Q

Creates a backup of the bootloader

A

dd if=/dev/sda of=backup_bootloader

bs=512 count=1

205
Q

Creates the archive file.tar from the files file1 and file2

A

tar -cf file.tar file1 file2

206
Q

Displays the content of the file.tar archive without unpacking it

A

tar -tf file.tar

207
Q

Inserts file3 into the existing archive file.rar

A

tar rf file.tar file3

208
Q

Extracts the archive file.tar

A

tar -xf file.tar

209
Q

Extracts the archive file.tar and outputs a result

A

tar -xvf file.tar

210
Q

Creates a gzip-compressed archive called file3.tar.gz from file1 and file2

A

tar -cvzf file3.tar.gz file1 file2

211
Q

Shows the content of the archive file3.tar.gz compressed with gzip

A

tar -tzf file3.tar.gz

212
Q

Unpacks the gzip-compressed archive file3.tar.gz

A

tar -xzvf file3.tar.gz

213
Q

Creates a bzip2-compressed archive named file4.tar.bz2 from file1 and file2

A

tar -cvjf file4.tar.bz2 file1 file2

214
Q

Shows the content of the archive file4.tar.bz2

A

tar -tjf file4.tar.bz2

215
Q

Unpacks the bzip2-compressed archive file4.tar.bz2

A

tar -xjvf file4.tar.bz2

216
Q

Creates an xz-compressed archive called file5.tar.xz from file1 and file2

A

tar -cvJf file5.tar.xz file1 file2

217
Q

Shows the content of the archive file5.tar.xz compressed with xz

A

tar -tJf file5.tar.xz

218
Q

Unpacks the xz-compressed archive file5.tar.xz

A

tar -xvJf file5.tar.xz

219
Q

Lists the files of the directory in which we are located and directs forward this to the cpio command in copy out mode. This then creates the packed file content.cpio

A

ls | cpio -o > content.cpio

220
Q

Extracts the content.cpio file

A

cpio -i < content.cpio

221
Q

Displays the content of the content.cpio file without extracting it

A

cpio -it < content.cpio

222
Q

Searches for all subdirectories and files in the current directory and sends the result to spio. This is called in pass through mode and copies the files to the /tmp/test directory that is created, if not yet available

A

find . -depth | cpio -pd /tmp/test

223
Q

Compresses file1 to file1.gz

A

gzip file1

224
Q

Compresses file1 to file1.gz and file2 to file2.gz

A

gzip file1 file2

225
Q

Compresses file4 to file4.gz without deleting file4 afterwards

A

gzip -k file4

226
Q

Extracts file1.gz to file1

A

gzip -d file1.gz

227
Q

Extracts file2.gz to file2 without dleting file2.gz afterwards

A

gzip -dk file2.gz

228
Q

Extracts file3.gz to file3

A

gunzip file3.gz

229
Q

Compresses file1 to file1.bz2

A

bzip2 file1

230
Q

Extracts file1.bz2 to file1 without deleting file1.bz2 afterwards

A

bzip2 -dk file1.bz2

231
Q

Extracts file1.bz2 to file1

A

bunzip2 file1.bz2

232
Q

Compresses file1 to file1.xz

A

xz file1

233
Q

Compresses file2 to file2.xz without deleting file2 afterwards

A

xz -k file2

234
Q

Extracts file2.xz to file2

A

xz -d file2.xz

235
Q

Extracts file2.xz to file2

A

unxz file2.xz

236
Q

Shows all files in the current directory that have the file extension .txt in use

A

ls *.txt

237
Q

Displays all files in the current directory that start with the word test

A

ls test*

238
Q

Shows all files in the current directory whose names consist of only one letter and have the file extension .txt

A

ls ?.txt

239
Q

Displays all files in the current directory whose names consist of just two letters and have the file extension.txt

A

ls ??.txt

240
Q

Lists files that begin with test or Test and have the file extension .csv

A

ls [tT]est*.csv

241
Q

Lists all files that begin with test and immediately afterwards a 1,2,3 or 4 follows

A

ls test[1-4].txt

242
Q

Lists all files that begin with test and immediately theraafter NONE 1 or 2 follows

A

ls test[^1-2]

243
Q

Lists files that begin with the word table or chair

A

ls {table,chair}*

244
Q

Lists files that begin with table or test, but not with a 1 or 2 continue. the file extension must begin with T or t and with X or x plus any other character.

A

ls {table,test} [^1-2]*.[Tt][Xx]?

245
Q

Saves the result in the file list.txt. Possibly previously existing content this file will be overwritten / deleted

A

ls -la / > list.txt

246
Q

Saves the result in the file list.txt. Previously existing content becomes thus not deleted. The new content is simply attached to the back.

A

ls -la /bin&raquo_space; list.txt

247
Q

Forwards the result to the standard output channel. 1 = STDOUT. In this case it is the file liste2.txt

A

ls -la 1> liste2.txt

248
Q

Redirects the STDERR channel to error.txt. I.e. if ls -zb an error outputs, the error output is saved in the error.txt file

A

ls -zb 2> error.txt

249
Q

The result is redirected (STDOUT) to the liste.txt file. Possible error messages (STDERR) are redirected to the error.txt file.

A

ls -la > liste.txt 2> error.txt

250
Q

Redirects both STDOUT and STDERR to the liste3.txt file

A

ls -la > liste3.txt 2>&1

251
Q

STDIN is not the keyboard at this point, but the file1 that we are at forward the command wc -l

A

wc -l < file1

252
Q

Here we have used the keyboard as the STDIN. The result is the same as with the STDIN redirection from a file

A

wc -l file1

253
Q

STDIN is not the keyboard at this point, but the file1 that we are at forward the command wc -l. This is just a different notation. 0 = STDIN

A

wc -l 0< file1

254
Q

Opens an interactive mode in which you can write commands / texts until the word HEREDOC is written

A

wc -l &laquo_space;HEREDOC

255
Q

The content of the variable is passed on to tr. tr ensures that the Result is output in capital letters

A

tr ‘a-z’ ‘A-Z’ «< $VARIABLE

256
Q

Outputs the result of ls -la on the screen and writes i as well also in the file list4.txt

A

ls -la | tee list4.txt

257
Q

Outputs the result of ls -la on the screen and writes it as well also in the file list4.txt. The old content will not be overwritten.

A

ls -la | tee -a list4.txt

258
Q

Lists all .bak files side by side

A

find *.bak | xargs

259
Q

Deletes all .bak files in the corresponding directory

A

find *.bak | xargs rm

260
Q

Returns the words from the file xargs-file side by side

A

cat xargs-file | xargs

261
Q

Returns the words from the file xargs-file side by side

A

xargs -a xargs-file

262
Q

The employee abbreviations in the employees.txt file are no longer written one below the other, but side by side. The result is passed to tr which converts the uppercase letters to lowercase letters. The result is saved in the file employees2.txt

A

xargs -a employees.txt | tr ‘AZ’ ‘a-z’ > employees2.txt

263
Q

Shows all processes that are currently active (detailed)

A

ps -ef

264
Q

Shows all processes in a tree view

A

pstree

265
Q

Shows all processes in a tree view, including process ID

A

pstree -p

266
Q

Dynamic overview of all running processes

A

top

267
Q

Opens the top program, which in turn only displays the processes with process IDs 1127 and 1128

A

top -p 1127,1128

268
Q

Shows statistics on RAM and SWAP memory

A

free

269
Q

Shows the RAM and SWAP data in megabytes

A

free -m

270
Q

Shows the RAM and SWAP data in gygabytes

A

free -g

271
Q

Shows the RAM and SWAP data in bytes

A

free -b

272
Q

Shows the RAM and SWAP data in the “best” readable format

A

free -h

273
Q

Displays the process ID of nginx

A

pgrep nginx

274
Q

Displays the process ID and name of the nginx process

A

pgrep -l nginx

275
Q

Displays all possible kill signals

A

kill -l

276
Q

Sends the SIGTERM (15) signal to processes 1152 and 1153, resulting in leads to an orderly shutdown

A

kill 1152 1153

277
Q

Sends the SIGTERM (15) signal to processes 1152 and 1153, resulting in leads to an orderly shutdown

A

kill -SIGTERM 1152 1153

278
Q

Sends the SIGTERM (15) signal to processes 1152 and 1153, resulting in leads to an orderly shutdown

A

kill -15 1152 1153

279
Q

Sends the SIGTERM (15) signal to processes 1152 and 1153, resulting in leads to an orderly shutdown

A

kill -TERM 1152 1153

280
Q

Sends the SIGKILL (9) signal to process 1152, causing the process is rigorously killed

A

kill -9 1152

281
Q

Sends the SIGSTOP (19) signal to process 1152, causing the process to be stopped/paused

A

kill -SIGSTOP 1152

282
Q

Sends the SIGCONT (18) signal to process 1152, which results in the paused process is continued

A

kill -SIGCONT 1152

283
Q

Sends the SIGTERM (15) signal to the process with the exact name “nginx”

A

pkill -x nginx

284
Q

Shows all signals that killall can send

A

killall -l

285
Q

Kills all processes that run under the user Manuel

A

killall -u manuel

286
Q

Sends the SIGSTOP (19) signal to the process currently running in the foreground

A

STRG+Z

287
Q

Brings a process paused with SIGSTOP (19) back to the foreground (process starts again)

A

fg

288
Q

Brings a process paused with SIGSTOP (19) into the background (process starts again)

A

bg

289
Q

Sends the SIGINT (2) signal to the process currently in the foreground running, which leads to the terminal connection of the process interrupted and this is stopped

A

STRG+C

290
Q

Starts the sleep program with 500 seconds in the background

A

sleep 500 &

291
Q

Shows the processes in the background

A

jobs

292
Q

Starts the sleep program with 1000 seconds in the background. If you log off from the system, the program continues and will not go through SIGHUB (1) ended

A

nohup sleep 1000 &

293
Q

Runs the uptime program every 2 seconds

A

watch uptime

294
Q

Runs the uptime program every 5 seconds

A

watch -n 5 uptime

295
Q

Runs the sleep program with 1000 seconds in the background and assigns the nice value 5

A

nice -n 5 sleep 1000 &

296
Q

Starts the sleep program with 2000 seconds and a nice value of 10 (10 = standard)

A

Assigns a new nice value (2) to a process that is already running with the Process ID 4512

297
Q

Gives all processes that run manually under the user Manuel a new nice value (1)

A

renice 1 -u manuel

298
Q

Shows a table with running processes including PID and nice value

A

ps -efo pid,ni,cmd

299
Q

Searches the /etc/passwd file and prints out all lines that start with the name manuel

A

grep manuel /etc/passwd

300
Q

Searches the /etc/passwd file and prints out any lines that do NOT include the name manuel

A

grep -v manuel /etc/passwd

301
Q

Searches the /etc/passwd file and prints out any lines that do NOT include tha name manuel. In addition, line numbering inserted.

A

grep -vn manuel /etc/passwd

302
Q

Searches the /etc/passwd file and only outputs the words / names that you was looking for, so in this case manuel

A

grep -o manuel /etc/passwd

303
Q

Searches the regex.txt file for the word “this”, which is, however must be at the beginning of the line. -i option ignores the case

A

grep -i “^this” regex.txt

304
Q

Searches the regex.txt file for the word “example” +1 anything Character, which must be at the end of the line

A

grep -i “example.$” regex.txt

305
Q

Searches the regex.txt file for the word “example” and a following point (must again be at the end of the line)

A

grep -i “example.$” regex.txt

306
Q

Searches the regex.txt file for the words “wonderful” or “wonderbra”. grep must be used in extended mode (-E / egrep)

A

grep -E “wonder(full|bra)” regex.txt

307
Q

Searches the regex.txt file for the words “wonderful” or “wonderbra”. grep must be used in extended mode (-E / egrep)

A

egrep “wonder(full|bra)” regex.txt

308
Q

Searches the regex.txt file for everything except the words “wonderful” and “wonderbra”

A

egrep -v “wonder(full|bra)” regex.txt

309
Q

the fgrep command searches for fixed-character strings in a file or files. “Fixed-character” means the string is interpreted literally — metacharacters do not exist, and therefore regular expressions cannot be used. With the -f option it takes the list of patterns from pattern-file.

A

fgrep “support” myfile.txt

fgrep -f words.txt myfile.txt

310
Q

Starts the vi text editor

A

vi

311
Q

vi starts and at the same time opens testfile or creates it, if it does not exist

A

vi testfile

312
Q

Closes vi without saving first

A

:q

313
Q

Saves and closes vi

A

:wq

314
Q

Saves without closing vi

A

:w

315
Q

Saves and closes vi

A

ZZ

316
Q

Saves and closes vi

A

:x

317
Q

Lists all partitions

A

fdisk -l

318
Q

Starts fdisk in interactive mode to edit the hard disk /dev/sdb

A

fdisk /dev/sdb

319
Q

Writes the ext4 file system to the /dev/sdb1 partition

A

mkfs.ext4 /dev/sdb1

320
Q

Writes the ext4 file system to the /dev/sdb1 partition

A

mkfs -t ext4 /dev/sdb1

321
Q

Shows us the individual hard drives including file systems

A

lsblk -f

322
Q

Writes the ext3 file system to the /dev/sdc1 partition

A

mkfs.ext3 /dev/sdc1

323
Q

Writes the ext2 file system to the /dev/sdc1 partition

A

mkfs.ext2 -j /dev/sdc1

324
Q

Wrtes the ext2 file system to the /dev/sdd1 partition

A

mkfs /dev/sdd1

325
Q

Creates a swap partition (SWAP) in /dev/sdb1

A

mkswap /dev/sdb1

326
Q

Mounts the new SWAP partition /dev/sdb1 into the system

A

swapon /dev/sdb1

327
Q

Starts gdisk in interactive mode to edit the hard drive /dev/sdc

A

gdisk /dev/sdc

328
Q

Shows the individual hard drives and their partitions

A

parted -l

329
Q

Starts parted in interactive mode to edit the hard disk /dev/sdc

A

parted /dev/sdc

330
Q

Lists the space used by each file

A

du /

331
Q

Lists the total used space

A

du -hs /

332
Q

Displays the used space of /usr

A

du -hs /usr

333
Q

Shows the used space of the files and directories of /home, up to a maximum of 4 subfolders

A

du -h –max-depth=4 /home

334
Q

Shows the inodes of the partitions

A

df -i

335
Q

Checks the file system on /dev/sdc1 for errors if /dev/sdc is not mounted

A

fsck /dev/sdc1

336
Q

Creates an ext4 filesystem on /dev/sdc1

A

mke2fs -t etx4 /dev/sdc1

337
Q

Outputs the current file system values

A

tune2fs -l /dev/sda1

338
Q

Sets the maximum mount count of /dev/sda1 to the value 100

A

tune2fs -c 100 /dev/sda1

339
Q

Specifies the last time a file system check was performed

A

tune2fs -T 20200501 /dev/sda1

340
Q

Specifies that a file system check should be carried out every 5 days

A

tune2fs -i 5d /dev/sda1

341
Q

Checks the XFS file system on /dev/sdd1 and lists errors without repairing them

A

xfs_repair -n /dev/sdd1

342
Q

Checks the XFS file system on /dev/sdd1 and repairs errors

A

xfs_repair -v /dev/sdd1

343
Q

Improves the organization of data in the file system of /dev/sdd1, similar like a defragmentation

A

xfs_fsr /dev/sdd1

344
Q

Mounts the partition /dev/sdb1 as ext4 to /mnt/newhdd

A

mount -t ext4 /dev/sdb1 /mnt/newhdd

345
Q

Unmounts the /dev/sdb1 partition

A

unmount /dev/sdb1

346
Q

Unmounts the /dev/sdb1 partition

A

unmount /mnt/newhdd

347
Q

Mounts all partitons listed in the /etc/fstab file

A

mount -a

348
Q

Starts the interactive mode of xfs_db

A

xfs_db /dev/sdd1

349
Q

Outputs the UUID, labels, tupes and PARTUUID of hard disks

A

blkid

350
Q

Queries the status of the mount point /hdd2

A

systemctl status /hdd2

351
Q

Unmounts the hard drive / partititon that i mounted to /hdd2

A

systemctl stop /hdd2

352
Q

Mounts the hard drive / partition to /hdd2

A

systemctl start /hdd2

353
Q

gives the file 664 permission

A

chmod 664 file.4711

354
Q

gives the file 755 permission

A

chmod u=rwx,g=rx,o=rx file.4711

355
Q

gives the file 755 permission

A

chmod u=rwx,go=rx file4711

356
Q

Adds the Write (w) group permission to the file

A

chmod g+w file.4711

357
Q

Sets the sticky bit to the test directory. This means that everyone is only allowed to delete their own files and not others, although they have full control

A

chmod 1777 test

358
Q

Sets the SetUID bit for the test.sh file. This allows a normal user to start the script with root rights even though he is not root himself.

A

chmod 4777 test.sh

359
Q

Sets the SetGID bit on the test.sh file. This allows a user to use the script with the permissions of the appropriate owner group

A

chmod 2777 test.sh

360
Q

Sets the owner and the owner group of the file.4811 to thomas

A

chown thomas:thomas file.4811

361
Q

Only sets the owner group file file.4811 to manuel

A

chown :manuel file.4811

362
Q

Sets the owner and owner group of the tar directory and all subdirectories and files on thomas

A

chown -R thomas:thomas tar

363
Q

Sets the owner group of the tar directory and all subdirectories and files on manuel

A

chgrp -R manuel tar

364
Q

Displays the current umask value

A

umask -p

365
Q

Changes the umask to the value 0026

A

umask 0026

366
Q

Displays the current umask value

A

umask -S

367
Q

Print value of a symbolic link

A

readlink -link path-

ex.: readlink /bin/sh Shows to which shell points on distribution

368
Q

Change to most recent directory

A

cd -

369
Q

Ways to change to home directory

A

cd
cd ~
cd $HOME

370
Q

To search for keywords in the documentation

A
-k option
$  man -k passwd  
 […] 
 passwd (1)           - update user's authentication tokens 
 […] 
 passwd (5)           - password file 
 […] 
 smbpasswd (5)        - The Samba encrypted password file 
 […] 
 $
371
Q

Display the byte count of the file’s longest line.

A

wc -L -file-

372
Q

List files by type

A

ls -F
/ - Directory
@ - Link
* - Executable