unix Flashcards
uname -r
Shows the kernel version (release)
uname -m
Displays the system architecture
uname -a
Displays all information that uname can output
lscpu
Shows details about the CPU
lsmod
Shows the running kernel modules
modinfo
Displays detailed information about a kernel module
modinfo -a
Shows the author of a kernel module
modinfo -d
Shows a brief description of the kernel module
modinfo -l
Shows the license under which the kernel module is located
modprobe
Loads a kernel module into the kernel
modprobe -r
Unloads a kernel module from the kernel
lspci
Lists all PCI devices
lspci -v
Lists all PCI devices in a more detailed view
lspci -vv / lspci -vvv
Lists all PCI devices in an even more detailed view
lspci -k
Lists all PCI devices
lsusb
Lists all USB devices
lsusb -v
Lists all USB devices in a more detailed view
lsusb -s 002
Lists only the USB devices on bus 002
lsusb -d
Only shows the USB devices of the respective manufacturer
lsusb -t
Displays the USB devices in a tree view
pstree
Shows running processes in a tree view
pstree -p
Shows running processes including the process ID in a tree view
dmesg
Reads the kernel ring buffer (kernel boot logs)
journalctl
Displays all systemd logs
journalctl -k
Displays all systemd logs related to the kernel
chkconfig –list
Shows the services that are started automatically
service start
Starts a process (on SysVinit systems)
service stop
Stops a process (on SysVinit systems)
service status
Shows the status of a process (on SysVinit systems)
initctl list
Shows a list of all init services + their status
initctl start
Starts a process (on upstart systems)
initctl stop
Stops a process (on upstart systems)
initctl status
Shows the status of a process (on upstart systems)
systemctl start
Starts a process (on systemd systems)
systemctl stop
Stops a process (on systemd systems)
systemctl status
Shows the status of a process (on systemd systems)
systemctl list-units
Lists all systemd units of the system including status
systemctl restart
Restarts a process (on systemd systems)
runlevel
Shows in which runlevel you are currently and before
init 3
Changes to run level 3
telinit 3
Changes to run level 3
systemctl isolate multi-user.target
Changes to the boot target Multi-User.Target (systemd)
systemctl get-default
Displays the set standard boot target
systemctl set-default multi-user.target
Sets the standard boot target to Multi-User.Target
systemctl isolate reboot.target
Restarts the system
systemctl isolate poweroff.target
Turns off the system
shutdown -r +10
Restarts the system in 10 minutes
shutdown -c
Deletes the previously set waiting time and thus the entire command
shutdown -r now
Immediately restart the system
shutdown -h now
Shuts down the system immediately
halt
Shuts down the system
poweroff
Shuts down the system
reboot
Reboots the system
wall
Sends a message through the system to logged-in users
swapon -s
Displays the swap partitions or files in use
swapoff -a
All swap files or swap partitions will be stopped
swapon -a
Any swap files or swap partitions will start
lsblk
Lists all block devices (hard drives)