Linux misc things - RayGutt/PersonalWiki GitHub Wiki

Linux misc. things

# Display distribution and version
$ lsb_release -d
Description:    Ubuntu 18.04.3 LTS
# Change static IP address
$ sudo vi /etc/netplan/01-host-only.yaml
network:
    version: 2
    renderer: networkd
    ethernets:
        enp0s8:
                dhcp4: no
                addresses: [192.168.56.120/24]
                gateway4: 192.168.1.1
                nameservers:
                    addresses: [192.168.1.1, 8.8.8.8]


$ sudo netplan apply
# also edit /etc/hosts
# See the result:
$ ip address show

see: https://www.linux.com/tutorials/how-use-netplan-network-configuration-tool-linux/

# Change hostname
$ sudo hostnamectl set-hostname visual-tom-server
# Also edit /etc/hosts
sudo vi /etc/hosts
# Change MOTD
# add an executable script in /etc/update-motd.d/
-rwxr-xr-x 1 root root 1220 Apr  9  2018 00-header
.........
-rwxr-xr-x 1 root root   31 Jan 16 13:14 99-visual-tom
# List installed packages
$ sudo apt list --installed 
⚠️ **GitHub.com Fallback** ⚠️