unix Flashcards

1
Q

uname -r

A

Shows the kernel version (release)

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

uname -m

A

Displays the system architecture

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

uname -a

A

Displays all information that uname can output

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

lscpu

A

Shows details about the CPU

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

lsmod

A

Shows the running kernel modules

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

modinfo

A

Displays detailed information about a kernel module

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

modinfo -a

A

Shows the author of a kernel module

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

modinfo -d

A

Shows a brief description of the kernel module

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

modinfo -l

A

Shows the license under which the kernel module is located

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

modprobe

A

Loads a kernel module into the kernel

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

modprobe -r

A

Unloads a kernel module from the kernel

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

lspci

A

Lists all PCI devices

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

lspci -v

A

Lists all PCI devices in a more detailed view

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

lspci -vv / lspci -vvv

A

Lists all PCI devices in an even more detailed view

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

lspci -k

A

Lists all PCI devices

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

lsusb

A

Lists all USB devices

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

lsusb -v

A

Lists all USB devices in a more detailed view

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

lsusb -s 002

A

Lists only the USB devices on bus 002

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

lsusb -d

A

Only shows the USB devices of the respective manufacturer

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

lsusb -t

A

Displays the USB devices in a tree view

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

pstree

A

Shows running processes in a tree view

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

pstree -p

A

Shows running processes including the process ID in a tree view

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

dmesg

A

Reads the kernel ring buffer (kernel boot logs)

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

journalctl

A

Displays all systemd logs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
journalctl -k
Displays all systemd logs related to the kernel
26
chkconfig --list
Shows the services that are started automatically
27
service start
Starts a process (on SysVinit systems)
28
service stop
Stops a process (on SysVinit systems)
29
service status
Shows the status of a process (on SysVinit systems)
30
initctl list
Shows a list of all init services + their status
31
initctl start
Starts a process (on upstart systems)
32
initctl stop
Stops a process (on upstart systems)
33
initctl status
Shows the status of a process (on upstart systems)
34
systemctl start
Starts a process (on systemd systems)
35
systemctl stop
Stops a process (on systemd systems)
36
systemctl status
Shows the status of a process (on systemd systems)
37
systemctl list-units
Lists all systemd units of the system including status
38
systemctl restart
Restarts a process (on systemd systems)
39
runlevel
Shows in which runlevel you are currently and before
40
init 3
Changes to run level 3
41
telinit 3
Changes to run level 3
42
systemctl isolate multi-user.target
Changes to the boot target Multi-User.Target (systemd)
43
systemctl get-default
Displays the set standard boot target
44
systemctl set-default multi-user.target
Sets the standard boot target to Multi-User.Target
45
systemctl isolate reboot.target
Restarts the system
46
systemctl isolate poweroff.target
Turns off the system
47
shutdown -r +10
Restarts the system in 10 minutes
48
shutdown -c
Deletes the previously set waiting time and thus the entire command
49
shutdown -r now
Immediately restart the system
50
shutdown -h now
Shuts down the system immediately
51
halt
Shuts down the system
52
poweroff
Shuts down the system
53
reboot
Reboots the system
54
wall
Sends a message through the system to logged-in users
55
swapon -s
Displays the swap partitions or files in use
56
swapoff -a
All swap files or swap partitions will be stopped
57
swapon -a
Any swap files or swap partitions will start
58
lsblk
Lists all block devices (hard drives)
59
df
Lists all hard disks including storage space and mount point
60
blkid
Displays the UUID of a hard drive
61
mount
Shows all mounts of the system
62
pvs
Displays the physical volume (PV) (with installed LVM)
63
vgs
Displays the volume groups (VG) (if LVM is installed)
64
lvs
Displays the logical volumes (LV) (if LVM is installed)
65
grub-install
Installs GRUB Legacy in the corresponding GRUB partition
66
grub
Opens a GRUB shell (legacy)
67
grub-mkconfig / grub2-mkconfig
Creates a new grub.cfg file (GRUB 2). To do this
68
update-grub
Same function as grub-mkconfig
69
ldd /path/program
Shows which libraries the respective program uses
70
ldconfig
Makes new libraries known system-wide
71
LD_LIBRARY_PATH
Variable in which a library path can be stored
72
dpkg -i
Installs the program
73
dpkg --configure
Configures the program (usually not necessary because this happens automatically during installation)
74
dpkg-reconfigure
Completely reconfigures
75
dpkg -L
Shows in which paths the program would be installed
76
dpkg -l
Shows a list of all installed packages on the system
77
dpkg -r
Removes from the system. Configuration files are retained!
78
dpkg -P
Removes including configuration files
79
dpkg --purge
Removes including configuration files
80
apt install ./
Installs the downloaded in the current directory
81
apt purge
Removes including all configuration files and dependencies
82
apt update
Updates the package sources from /etc/apt/sources.list
83
apt dist-upgrade
Updates the entire Linux system to the latest state
84
apt upgrade
Updates the system but does not delete any files. So refuses service when a file should be deleted
85
apt full-upgrade
Updates the system and also deletes files if necessary.
86
apt autoremove
Deletes files that are no longer needed due to a system update
87
apt-cache search
Searches for in the apt cache
88
apt-cache depends
Outputs the dependencies of (before the installation!)
89
aptitude install
Installs with aptitude
90
aptitude remove
Removes from the system. Configuration files are retained.
91
aptitude purge
Removes including configuration files from the system.
92
aptitude search
Searches for the package in the aptitude cache
93
aptitude
Starts the graphical user interface of aptitude
94
rpm -qpl
Shows in which paths the program would be installed
95
rpm -qpi
Displays detailed information on
96
rpm -i
Installs on the system (dependencies are not resolved independently!)
97
rpm -qa
Displays all programs installed on the system
98
rpm -e
Removes from the system (e = erase)
99
rpm -U
Updates to a newer version
100
rpm -qf /path/program
Shows from which package /path/program originated
101
yum update
Updates the entire system to the latest version (Red Hat systems)
102
yum search
Searches for in the package sources
103
yum info
Provides detailed information on
104
yum install
Installs including all dependencies
105
yum list installed
Displays all programs installed on the system
106
yum remove
Removes from the system
107
yum autoremove
Deletes files that are no longer needed due to a system update
108
yum whatprovides
Shows
109
yumdownloader
Downloads without installing it at the same time
110
zypper se
Searches for in the package sources (SUSE systems)
111
zypper install
Installs including all dependencies (SUSE systems)
112
zypper remove
Removes from the system
113
zypper list-updates
Displays the updates available for the system
114
zypper update
Updates the system to the current status
115
zypper repos
Shows the configured package sources from zypper
116
man 2
Displays man page 2 of
117
man 4
Displays man page 4 of
118
history
Displays a history of the most recently entered commands
119
HISTFILE
Variable that contains the file in which the history is saved
120
~/.bash_history
File in which the history is saved
121
echo $HISTFILE
Outputs the content of the HISTFILE variable
122
echo -e
Activates the possibility to output line breaks (\n) or TAB (\t)
123
env
Shows the environment variables including their values in bash
124
set
Shows further variables of the shell + different functions
125
set -x
Switches on the debug mode of the shell
126
set +x
Switches off the debug mode of the shell
127
unset VARIABLE
Deletes a variable
128
bash
Starts another bash in which we are located automatically (child process)
129
export VARIABLE
Creates a variable that can also be used in child processes
130
/proc
Virtual directory that represents running processes
131
/sys
Virtual directory that contains information about the system hardware and about kernel modules
132
/dev
Device directory
133
/sbin/init
The first process that is started with SysVinit or upstart systems
134
/etc/inittab
File that is consulted by init. Contains the standard run level
135
/etc/init.d
Start / stop scripts for init (Debian systems)
136
/etc/rc.d
Start / stop scripts for init (Red Hat systems)
137
/etc/init
Contains configuration files that are started at system start (upstart)
138
/etc/systemd/system
Contains the so-called systemd units that are started by systemd (systemd)
139
/lib/systemd/system
Contains the so-called systemd units that are started by systemd (systemd)
140
/etc/systemd/system.conf
Main configuration file of systemd
141
/bin
Contains basic system commands
142
/sbin
Contains basic system commands that can only be executed by root or users with root rights
143
/boot
Contains all the data required to boot the system
144
/etc
Contains configuration files from almost all programs on the system
145
/home
Contains the personal directories of the users
146
/lib
Contains dynamic libraries and kernel modules (/lib/modules/)