101 exam Flashcards

(372 cards)

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
Reads the kernel ring buffer (kernel boot logs)
dmesg
26
Displays all systemd logs
journalctl
27
Displays all systemd logs related to the kernel
journalctl -k
28
Shows the services that are started automatically, including runlevel (init)
chkconfig --list
29
Starts a process (on SysVinit systems)
service -process- start
30
Stops a process (on SysVinit systems)
service -process- stop
31
Shows the status of a process (on SysVinit systems)
service -process- status
32
Shows a list of all init services + their status
initctl list
33
Starts a process (on upstart systems)
initctl start -process-
34
Stops a process (on upstart systems)
initctl stop -process-
35
Shows the status of a process (on upstart systems)
initctl status -process-
36
Starts a process (on systemd systems)
systemctl start -process-
37
Stops a process (on systemd systems)
systemctl stop -process-
38
Shows the status of a process (on systemd systems)
systemctl status -process-
39
Lists all systemd units of the system including status
systemctl list-units
40
Restarts a process (on systemd systems)
systemctl restart -process-
41
Shows in which runlevel you are currently and before
runlevel
42
Changes to runlevel 3
init 3
43
Changes to runlevel 3
telinit 3
44
Changes to the boot target Multi-User.Target (systemd)
systemctl isolate multi-user.target
45
Displays the set standard boot target
systemctl get-default
46
Sets the standard boot target to Multi-User.Target
systemctl set-default multi-user.target
47
Restarts the system
systemctl isolate reboot.target
48
Turns off the system
systemctl isolate poweroff.target
49
Restarts the system in 10 minutes
shutdown -r +10
50
Deletes the previously set waiting time and thus the entire command
shutdown -c
51
Immediately restart the system
shutdown -r now
52
Shuts down the system immediately
shutdown -h now
53
Shuts down the system
halt
54
Shuts down the system
poweroff
55
Reboots the system
reboot
56
Sends a message through the system to logged-in users
wall -message-
57
Displays the swap partitions or files in use
swapon -s
58
All swap files or swap partitions will be stopped
swapoff -a
59
Any swap files or partitions will start
swapon -a
60
Lists all block devices (hard disks)
lsblk
61
Lists all hard disks including storage space and mount point
df
62
Displays the UUID of a hard drive
blkid
63
Shows all mounts of the system
mount
64
Displays the physical volume (PV) (with installed LVM)
pvs
65
Displays the volume groups (VG) (if LVM is installed)
vgs
66
Displays the logical volumes (LV) (if LVM is installed)
lvs
67
Installs GRUB Legacy in the corresponding GRUB partiiton
grub-install -grub partition-
68
Opens a GRUB shell (legacy)
grub
69
Creates a new grub.cfg file (GRUB 2). To do this, manual Changes have been made in the /etc/default/grub file
grub-mkconfig / grub2-mkconfig
70
Same function as grub-mkconfig, but only on debian systems available
update-grub
71
Shows which libraries the respective program uses
ldd /path/program
72
Makes new libraries known system-wide
ldconfig
73
Variable in which a library path can be stored
LD_LIBRARY_PATH
74
Installs the program -program.deb-
dpkg -i -program.deb-
75
Configures the program -program- (usually not necessary because this happens automatically during installation) ..dpkg..
dpkg --configure -program-
76
Completely reconfigures -program- ..dpkg..
dpkg-reconfigure -program-
77
Shows in which paths the program would be installed ..dpkg..
dpkg -L -program-
78
Shows a list of all installed packages on the system ..dpkg..
dpkg -l
79
Removes -program- from the system. Configuration files are retained! ..dpkg..
dpkg -r -program-
80
Removes -program- including configuration files ..dpkg..
dpkg -P -program-
81
Removes -program- including configuration files ..dpkg..
dpkg --purge -program-
82
Installs the -program.deb- downloaded in the current directory, including the corresponding dependencies ..apt..
apt install ./-program-
83
Removes -program- including all config files and dependencies, provided they are not used by other programs ..apt..
apt purge -program-
84
Updates the package sources from /etc/apt/sources.list
apt update
85
Updates the entire Linux system to the latest state ..apt..
apt dist-upgrade
86
Updates the system but does not delete any files. So refuses Service when a file should be deleted ..apt..
apt upgrade
87
Updates the system and also deletes files if necessary ..apt..
apt full-upgrade
88
Deletes files that are no longer needed due to a system update ..apt..
apt autoremove
89
Searches for -program- in the apt cache
apt-cache search -program-
90
Outputs the dependencies of -program- (before the installation) ..apt..
apt-cache depends -program-
91
Installed -program- with aptitude
aptitude install -program-
92
Removes -program- from the system. Configuration files are retained. ..aptitude..
aptitude remove -program-
93
Removes -program- including config files from the system ..aptitude..
aptitude purge -progaram-
94
Searches for the package -program- in the aptitude cache
aptitude search -program-
95
Starts the graphical user interface of aptitude
aptitude
96
Shows in which paths the program would be installed ..rpm..
rpm -qpl -program.rpm-
97
Displays detailed information on -program.rpm-
rpm -qpi -program.rpm-
98
Installs -program.rpm- on the system (dependencies are not resolved independently!)
rpm -i -program.rpm-
99
Displays all programs installed on the system ..rpm..
rpm -qa
100
Removes -program- from the system (e = erase) ..rpm..
rpm -e -program-
101
Updates -program.rpm- to a newer version
rpm -U -program.rpm-
102
Shows from which package /path/program originated ..rpm..
rpm -qf /path/program
103
Updates the entire system to the latest version (Red Hat systems) ..yum..
yum update
104
Searches for -program- in the package sources ..yum..
yum search -program-
105
Provides detailed information on -package name- ..yum..
yum info -package name-
106
Installed -program- including all dependencies ..yum..
yum install -program-
107
Displays all program installed on the system ..yum..
yum list installed
108
Removes -program- from the system ..yum..
yum remove -program-
109
Deletes files that are no longer needed due to a system update ..yum..
yum autoremove
110
Shows, among other things, which package -program- originally came from ..yum..
yum whatprovides -program-
111
Downloads -program- without installing it at the same time ..yum..
yumdownloader -program-
112
Searches for -program- in the package sources (SUSE systems) ..zypper..
zypper se -program-
113
Installes -program- including all dependencies (SUSE systems) ..zypper..
zypper install -program-
114
Removes -program- from the system ..zypper..
zypper remove -program-
115
Displays the updates available for the system ..zypper..
zypper list-updates
116
Updates the system to the current status ..zypper..
zypper update
117
Shows the configured package sources from zypper ..zypper..
zypper repos
118
Displays man page 2 of -command-
man 2 -command-
119
Displays a history of the most recently entered commands
history
120
Variable that contains the file in which the history is saved
HISTFILE
121
File in which the history is saved
~/.bash_history
122
Outputs the content of the HISTFILE variable
echo $HISTFILE
123
Activates the possibility to output line breaks (\ n) or TAB (\ t), for example
echo -e
124
Shows the environment variables including their values in bash
env
125
Shows further variables of the shell + different functions
set
126
Switches on the debug mode of the shell
set -x
127
Switches off the debug mode of the shell
set +x
128
Deletes a variable
unset VARIABLE
129
Starts another bash in which we are located automatically (child process)
bash
130
Creates a variable that can also be used in child processes
export VARIABLE
131
Copies the contents of file1 and file2 to file 3
cat file1 file2 > file3
132
Outputs the content of file1 page by page
less file1
133
Displays the first 10 lines of -file-
head -file-
134
Displays the first 20 lines of -file-
head -n 20 -file-
135
Displays the last 10 lines of -file-
tail -file-
136
Displays the last 20 line of -file-
tail -n 20 -file-
137
Displays the last lines of -file- in real time
tail -f
138
Outputs the content of a gz-compressed file
zcat -file.gz-
139
Outputs the content of a bz2-compressed file
bzcat -file.bz2-
140
Outputs the content of a xz-compressed file
xzcat -file.xz-
141
Opens the text file with line numbers (only non-blank lines)
nl -file-
142
Empty lines are also given a line number
nl -ba -file-
143
Shows the number of lines and words in a document
wc -file-
144
Only shows the number of words
wc -w -file-
145
Only shows the number of lines
wc -l -file-
146
Creates a dump of -file- in octal notation
od -file-
147
Creates a dump of -file- in "normal" notation
od -c -file-
148
Creates a dump of -file- in binary notation
od -b -file-
149
Creates a dump of -file- in hexadecimal notation
od -h -file-
150
Creates a dump of -file- in ASCII notation
od -a -file-
151
Displays the hash value of -file-
md5sum -file-
152
Compares the saved hash value from -file- with the hash value of the Program and outputs a corresponding message
md5sum -c -file.md5-
153
Displays the hash value of -file- ..sha..
sha256sum -file- , sha512sum -file
154
Sorts -table.csv- based on the first number
sort -table.csv-
155
Sorts -table.csv- based on the whole number
sort -n -table.csv-
156
Sorts -table.csv- based on the data in the third column
sort -t "," -k3 -table.csv-
157
Deletes identical lines from -file.txt- that are directly below each other
uniq -file.txt-
158
Deletes identical lines from -file.txt- that are directly below each other and at the same time shows how often these lines occurred
uniq -c -file.txt-
159
Groups identical lines from -file.txt-
uniq --group -file.txt-
160
Replaces the commas in table.csv with semicolons
cat table.csv | tr ',' ';'
161
Removes the commas from table.csv
cat table.csv | tr -d ','
162
Replaces lower case letters in table.csv with upper case letters
cat table.csv | tr 'a-z' 'A-Z'
163
Outputs only the fourth column of table.csv
cut -d ',' -f 4 table.csv
164
Outputs columns 1,2 and 4 of table.csv
cut -d ',' -f 1,2,4 table .csv
165
Outputs the content of both files separated by a TAB (standard)
paste -file1- -file2-
166
Outputs the content of both files separated by a semicolon
paste -d ',' -file1- -file2-
167
Outputs the content of both files line by line, separated by a colon
paste -d "," -s -file1- -file2-
168
Replaces the word "colleague" in table.csv with the word "employee"
sed 's/colleague/employee/g' table.csv
169
Replaces the word "colleague" in table.csv with the word "employee". This is saved directly in table.csv.
sed -i 's/colleague/employee/g' table.csv
170
Creates several small files of 1000 bytes each from a large file
split -b 1000 -file-
171
Shows the directory in which you are currently located
pwd
172
Changes to /path/to/directory
cd /path/to/directory
173
Changes back one directory in the directory tree
cd ..
174
Changes to the personal home directory
cd ~
175
Changes to the directory you were in before
cd -
176
Copies -file- to /tmp
cp -file- /tmp
177
Copies -fiel- to /tmp. If the file already exists there, we asked if we want to overwrite this
cp -i -file- /tmp
178
Copies -file- to /tmp while keeping the time stamp of the source file
cp -p -file- /tmp
179
Copies the directory /tmp including files and subdirectories into the Directory in which we area currently
cp -r /tmp .
180
Moves -file- to the /tmp directory
mv -file- /tmp
181
Renames file1 to file2
mv -file1- file2-
182
Creates an empty file named "file" or changes the timestamp of an already existing file "file"
touch -file-
183
Sets the timestamp of -file- to 04/012019 at 12:34 p.m. and 21 seconds
touch -t 201904011234.21 -file-
184
Shows what kind of file it is (e.g. ASCII text tile)
file -file-
185
Lists the contents of a directory
ls
186
Lists the contents of a directory, including hidden files
ls -a
187
Lists the contents of a directory in a detailed view
ls -l
188
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
ls -lh
189
Shows the content of a directory, including the subdirectories
ls -R
190
Sorts the output according to the files last edited. The last edited file is at the bottom
ls -ltr
191
Creates a directory called "test"
mkdir test
192
Creates three directories "test1-3"
mkdir test1 test2 test3
193
Creates the directory "test4" and the subdirectory "test5" and its subdirectory "test6"
mkdir -p test4/test5/test6
194
Deletes (empty) directory
rmdir -directory-
195
Deletes -directory 1- and its sub-folder -directory 2-
rmdir -p -directory1/directory2-
196
Deletes -file-
rm -file-
197
Before deleting, asks whether we are really sure
rm -i -file-
198
Deletes -file- and then issues a success message
rm -v -file-
199
Deletes -directory- including subfolders and files
rm -rf ./-directory-
200
Searches (and finds, if available) -filename-
find -name -file-
201
Looks for files with the extension .log in the /var directory
find /var -name *.log
202
Creates an exact image from /dev/sda1 to /dev/sdb1
dd if=/dev/sda1 of=/dev/sdb1
203
Searches in / for log files, but only with a maximum of 4 subdirectories
find / -maxdepth 4 -name *.log
204
Creates a backup of the bootloader
dd if=/dev/sda of=backup_bootloader | bs=512 count=1
205
Creates the archive file.tar from the files file1 and file2
tar -cf file.tar file1 file2
206
Displays the content of the file.tar archive without unpacking it
tar -tf file.tar
207
Inserts file3 into the existing archive file.rar
tar rf file.tar file3
208
Extracts the archive file.tar
tar -xf file.tar
209
Extracts the archive file.tar and outputs a result
tar -xvf file.tar
210
Creates a gzip-compressed archive called file3.tar.gz from file1 and file2
tar -cvzf file3.tar.gz file1 file2
211
Shows the content of the archive file3.tar.gz compressed with gzip
tar -tzf file3.tar.gz
212
Unpacks the gzip-compressed archive file3.tar.gz
tar -xzvf file3.tar.gz
213
Creates a bzip2-compressed archive named file4.tar.bz2 from file1 and file2
tar -cvjf file4.tar.bz2 file1 file2
214
Shows the content of the archive file4.tar.bz2
tar -tjf file4.tar.bz2
215
Unpacks the bzip2-compressed archive file4.tar.bz2
tar -xjvf file4.tar.bz2
216
Creates an xz-compressed archive called file5.tar.xz from file1 and file2
tar -cvJf file5.tar.xz file1 file2
217
Shows the content of the archive file5.tar.xz compressed with xz
tar -tJf file5.tar.xz
218
Unpacks the xz-compressed archive file5.tar.xz
tar -xvJf file5.tar.xz
219
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
ls | cpio -o > content.cpio
220
Extracts the content.cpio file
cpio -i < content.cpio
221
Displays the content of the content.cpio file without extracting it
cpio -it < content.cpio
222
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
find . -depth | cpio -pd /tmp/test
223
Compresses file1 to file1.gz
gzip file1
224
Compresses file1 to file1.gz and file2 to file2.gz
gzip file1 file2
225
Compresses file4 to file4.gz without deleting file4 afterwards
gzip -k file4
226
Extracts file1.gz to file1
gzip -d file1.gz
227
Extracts file2.gz to file2 without dleting file2.gz afterwards
gzip -dk file2.gz
228
Extracts file3.gz to file3
gunzip file3.gz
229
Compresses file1 to file1.bz2
bzip2 file1
230
Extracts file1.bz2 to file1 without deleting file1.bz2 afterwards
bzip2 -dk file1.bz2
231
Extracts file1.bz2 to file1
bunzip2 file1.bz2
232
Compresses file1 to file1.xz
xz file1
233
Compresses file2 to file2.xz without deleting file2 afterwards
xz -k file2
234
Extracts file2.xz to file2
xz -d file2.xz
235
Extracts file2.xz to file2
unxz file2.xz
236
Shows all files in the current directory that have the file extension .txt in use
ls *.txt
237
Displays all files in the current directory that start with the word test
ls test*
238
Shows all files in the current directory whose names consist of only one letter and have the file extension .txt
ls ?.txt
239
Displays all files in the current directory whose names consist of just two letters and have the file extension.txt
ls ??.txt
240
Lists files that begin with test or Test and have the file extension .csv
ls [tT]est*.csv
241
Lists all files that begin with test and immediately afterwards a 1,2,3 or 4 follows
ls test[1-4].txt
242
Lists all files that begin with test and immediately theraafter NONE 1 or 2 follows
ls test[^1-2]
243
Lists files that begin with the word table or chair
ls {table,chair}*
244
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.
ls {table,test} [^1-2]*.[Tt][Xx]?
245
Saves the result in the file list.txt. Possibly previously existing content this file will be overwritten / deleted
ls -la / > list.txt
246
Saves the result in the file list.txt. Previously existing content becomes thus not deleted. The new content is simply attached to the back.
ls -la /bin >> list.txt
247
Forwards the result to the standard output channel. 1 = STDOUT. In this case it is the file liste2.txt
ls -la 1> liste2.txt
248
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
ls -zb 2> error.txt
249
The result is redirected (STDOUT) to the liste.txt file. Possible error messages (STDERR) are redirected to the error.txt file.
ls -la > liste.txt 2> error.txt
250
Redirects both STDOUT and STDERR to the liste3.txt file
ls -la > liste3.txt 2>&1
251
STDIN is not the keyboard at this point, but the file1 that we are at forward the command wc -l
wc -l < file1
252
Here we have used the keyboard as the STDIN. The result is the same as with the STDIN redirection from a file
wc -l file1
253
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
wc -l 0< file1
254
Opens an interactive mode in which you can write commands / texts until the word HEREDOC is written
wc -l << HEREDOC
255
The content of the variable is passed on to tr. tr ensures that the Result is output in capital letters
tr 'a-z' 'A-Z' <<< $VARIABLE
256
Outputs the result of ls -la on the screen and writes i as well also in the file list4.txt
ls -la | tee list4.txt
257
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.
ls -la | tee -a list4.txt
258
Lists all .bak files side by side
find *.bak | xargs
259
Deletes all .bak files in the corresponding directory
find *.bak | xargs rm
260
Returns the words from the file xargs-file side by side
cat xargs-file | xargs
261
Returns the words from the file xargs-file side by side
xargs -a xargs-file
262
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
xargs -a employees.txt | tr 'AZ' 'a-z' > employees2.txt
263
Shows all processes that are currently active (detailed)
ps -ef
264
Shows all processes in a tree view
pstree
265
Shows all processes in a tree view, including process ID
pstree -p
266
Dynamic overview of all running processes
top
267
Opens the top program, which in turn only displays the processes with process IDs 1127 and 1128
top -p 1127,1128
268
Shows statistics on RAM and SWAP memory
free
269
Shows the RAM and SWAP data in megabytes
free -m
270
Shows the RAM and SWAP data in gygabytes
free -g
271
Shows the RAM and SWAP data in bytes
free -b
272
Shows the RAM and SWAP data in the "best" readable format
free -h
273
Displays the process ID of nginx
pgrep nginx
274
Displays the process ID and name of the nginx process
pgrep -l nginx
275
Displays all possible kill signals
kill -l
276
Sends the SIGTERM (15) signal to processes 1152 and 1153, resulting in leads to an orderly shutdown
kill 1152 1153
277
Sends the SIGTERM (15) signal to processes 1152 and 1153, resulting in leads to an orderly shutdown
kill -SIGTERM 1152 1153
278
Sends the SIGTERM (15) signal to processes 1152 and 1153, resulting in leads to an orderly shutdown
kill -15 1152 1153
279
Sends the SIGTERM (15) signal to processes 1152 and 1153, resulting in leads to an orderly shutdown
kill -TERM 1152 1153
280
Sends the SIGKILL (9) signal to process 1152, causing the process is rigorously killed
kill -9 1152
281
Sends the SIGSTOP (19) signal to process 1152, causing the process to be stopped/paused
kill -SIGSTOP 1152
282
Sends the SIGCONT (18) signal to process 1152, which results in the paused process is continued
kill -SIGCONT 1152
283
Sends the SIGTERM (15) signal to the process with the exact name "nginx"
pkill -x nginx
284
Shows all signals that killall can send
killall -l
285
Kills all processes that run under the user Manuel
killall -u manuel
286
Sends the SIGSTOP (19) signal to the process currently running in the foreground
STRG+Z
287
Brings a process paused with SIGSTOP (19) back to the foreground (process starts again)
fg
288
Brings a process paused with SIGSTOP (19) into the background (process starts again)
bg
289
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
STRG+C
290
Starts the sleep program with 500 seconds in the background
sleep 500 &
291
Shows the processes in the background
jobs
292
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
nohup sleep 1000 &
293
Runs the uptime program every 2 seconds
watch uptime
294
Runs the uptime program every 5 seconds
watch -n 5 uptime
295
Runs the sleep program with 1000 seconds in the background and assigns the nice value 5
nice -n 5 sleep 1000 &
296
Starts the sleep program with 2000 seconds and a nice value of 10 (10 = standard)
Assigns a new nice value (2) to a process that is already running with the Process ID 4512
297
Gives all processes that run manually under the user Manuel a new nice value (1)
renice 1 -u manuel
298
Shows a table with running processes including PID and nice value
ps -efo pid,ni,cmd
299
Searches the /etc/passwd file and prints out all lines that start with the name manuel
grep manuel /etc/passwd
300
Searches the /etc/passwd file and prints out any lines that do NOT include the name manuel
grep -v manuel /etc/passwd
301
Searches the /etc/passwd file and prints out any lines that do NOT include tha name manuel. In addition, line numbering inserted.
grep -vn manuel /etc/passwd
302
Searches the /etc/passwd file and only outputs the words / names that you was looking for, so in this case manuel
grep -o manuel /etc/passwd
303
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
grep -i "^this" regex.txt
304
Searches the regex.txt file for the word "example" +1 anything Character, which must be at the end of the line
grep -i "example.$" regex.txt
305
Searches the regex.txt file for the word "example" and a following point (must again be at the end of the line)
grep -i "example\.$" regex.txt
306
Searches the regex.txt file for the words "wonderful" or "wonderbra". grep must be used in extended mode (-E / egrep)
grep -E "wonder(full|bra)" regex.txt
307
Searches the regex.txt file for the words "wonderful" or "wonderbra". grep must be used in extended mode (-E / egrep)
egrep "wonder(full|bra)" regex.txt
308
Searches the regex.txt file for everything except the words "wonderful" and "wonderbra"
egrep -v "wonder(full|bra)" regex.txt
309
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.
fgrep "support" myfile.txt | fgrep -f words.txt myfile.txt
310
Starts the vi text editor
vi
311
vi starts and at the same time opens testfile or creates it, if it does not exist
vi testfile
312
Closes vi without saving first
:q
313
Saves and closes vi
:wq
314
Saves without closing vi
:w
315
Saves and closes vi
ZZ
316
Saves and closes vi
:x
317
Lists all partitions
fdisk -l
318
Starts fdisk in interactive mode to edit the hard disk /dev/sdb
fdisk /dev/sdb
319
Writes the ext4 file system to the /dev/sdb1 partition
mkfs.ext4 /dev/sdb1
320
Writes the ext4 file system to the /dev/sdb1 partition
mkfs -t ext4 /dev/sdb1
321
Shows us the individual hard drives including file systems
lsblk -f
322
Writes the ext3 file system to the /dev/sdc1 partition
mkfs.ext3 /dev/sdc1
323
Writes the ext2 file system to the /dev/sdc1 partition
mkfs.ext2 -j /dev/sdc1
324
Wrtes the ext2 file system to the /dev/sdd1 partition
mkfs /dev/sdd1
325
Creates a swap partition (SWAP) in /dev/sdb1
mkswap /dev/sdb1
326
Mounts the new SWAP partition /dev/sdb1 into the system
swapon /dev/sdb1
327
Starts gdisk in interactive mode to edit the hard drive /dev/sdc
gdisk /dev/sdc
328
Shows the individual hard drives and their partitions
parted -l
329
Starts parted in interactive mode to edit the hard disk /dev/sdc
parted /dev/sdc
330
Lists the space used by each file
du /
331
Lists the total used space
du -hs /
332
Displays the used space of /usr
du -hs /usr
333
Shows the used space of the files and directories of /home, up to a maximum of 4 subfolders
du -h --max-depth=4 /home
334
Shows the inodes of the partitions
df -i
335
Checks the file system on /dev/sdc1 for errors if /dev/sdc is not mounted
fsck /dev/sdc1
336
Creates an ext4 filesystem on /dev/sdc1
mke2fs -t etx4 /dev/sdc1
337
Outputs the current file system values
tune2fs -l /dev/sda1
338
Sets the maximum mount count of /dev/sda1 to the value 100
tune2fs -c 100 /dev/sda1
339
Specifies the last time a file system check was performed
tune2fs -T 20200501 /dev/sda1
340
Specifies that a file system check should be carried out every 5 days
tune2fs -i 5d /dev/sda1
341
Checks the XFS file system on /dev/sdd1 and lists errors without repairing them
xfs_repair -n /dev/sdd1
342
Checks the XFS file system on /dev/sdd1 and repairs errors
xfs_repair -v /dev/sdd1
343
Improves the organization of data in the file system of /dev/sdd1, similar like a defragmentation
xfs_fsr /dev/sdd1
344
Mounts the partition /dev/sdb1 as ext4 to /mnt/newhdd
mount -t ext4 /dev/sdb1 /mnt/newhdd
345
Unmounts the /dev/sdb1 partition
unmount /dev/sdb1
346
Unmounts the /dev/sdb1 partition
unmount /mnt/newhdd
347
Mounts all partitons listed in the /etc/fstab file
mount -a
348
Starts the interactive mode of xfs_db
xfs_db /dev/sdd1
349
Outputs the UUID, labels, tupes and PARTUUID of hard disks
blkid
350
Queries the status of the mount point /hdd2
systemctl status /hdd2
351
Unmounts the hard drive / partititon that i mounted to /hdd2
systemctl stop /hdd2
352
Mounts the hard drive / partition to /hdd2
systemctl start /hdd2
353
gives the file 664 permission
chmod 664 file.4711
354
gives the file 755 permission
chmod u=rwx,g=rx,o=rx file.4711
355
gives the file 755 permission
chmod u=rwx,go=rx file4711
356
Adds the Write (w) group permission to the file
chmod g+w file.4711
357
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
chmod 1777 test
358
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.
chmod 4777 test.sh
359
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
chmod 2777 test.sh
360
Sets the owner and the owner group of the file.4811 to thomas
chown thomas:thomas file.4811
361
Only sets the owner group file file.4811 to manuel
chown :manuel file.4811
362
Sets the owner and owner group of the tar directory and all subdirectories and files on thomas
chown -R thomas:thomas tar
363
Sets the owner group of the tar directory and all subdirectories and files on manuel
chgrp -R manuel tar
364
Displays the current umask value
umask -p
365
Changes the umask to the value 0026
umask 0026
366
Displays the current umask value
umask -S
367
Print value of a symbolic link
readlink -link path- | ex.: readlink /bin/sh Shows to which shell points on distribution
368
Change to most recent directory
cd -
369
Ways to change to home directory
cd cd ~ cd $HOME
370
To search for keywords in the documentation
``` -k option $ man -k passwd […] passwd (1) - update user's authentication tokens […] passwd (5) - password file […] smbpasswd (5) - The Samba encrypted password file […] $ ```
371
Display the byte count of the file’s longest line.
wc -L -file-
372
List files by type
ls -F / - Directory @ - Link * - Executable