- Update editor alternative
- Run docker with sudo without password (for docker group)
- User / group management
- Devices
- Ports
sudo update-alternatives --config editor
sudo visudo
Add the following line in
%docker ALL=(ALL) NOPASSWD: /usr/bin/dockerd
This command creates a user named harry
sudo useradd -m harry
Optional
-m
summons the command to create a home directory for the user and allows login
This command creates a group named porter
sudo groupadd porter
This command adds the user harry to the group porter
sudo usermod -aG porter harry
cat /etc/group
Use grep for filtering
lsblk -f
grep -qs '/media/wd' /proc/mounts && echo yes || echo no
-qs
flag means suppress and silent, good to be used inif
statement
sudo lsof -i -P -n | grep LISTEN
# or
sudo netstat -tulpn | grep LISTEN
# or
sudo ss -tulpn | grep LISTEN
# or
sudo lsof -i:22 # see a specific port such as 22