-
Notifications
You must be signed in to change notification settings - Fork 0
/
linux
79 lines (67 loc) · 1.46 KB
/
linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# see installed kernels
apt list --installed | grep linux-image
# list active kernel
uname -a
### links
# hard link
ln <source file/folder> <link file/folder>
# soft (symbolic) link
ln -s <source file/folder> <link file/folder>
# replace existing link
ln -sf <source file/folder> <link file/folder>
### System
# Display system info
inxi -Fxz
sudo lshw
lscpu
# GPU
sudo lshw -c video
inxi -G
# show installed NVidia drivers
apt list --installed | grep nvidia
# Storage
lsblk
blkid
### Networking
nmcli
# show IP address
ip addr ~ show ip address
# DNS
nslookup <domain name>
dig <domain name>
systemd-resolve --status
### Users/Groups
# all users are in /etc/passwd
cat /etc/passwd
# see if user exists on system
cat /etc/passwd | grep <user>
# all groups are in /etc/groups
cat /etc/group
# to find certain group
cat /etc/group | grep <group>
# add user (interactive)
sudo adduser <user>
# add user with home dir (manual)
sudo useradd -m <user>
sudo passwd <user>
# add a new group
sudo groupadd <group>
# add user to group
usermod -aG <group> <user>
# apply changes to <group> without having to log in/out
newgrp <group>
# show id of user and groups user belongs to
sudo id <user>
# show groups user belongs to
groups <user>
# remove user
sudo deluser --remove-home <user>
### Package management
# show package details
apt show <package>
# dependencies
sudo apt depends <package>
sudo apt rdepends <package>
### DNS
sudo systemd-resolve --flush-cache
sudo systemd-resolve --statistics