Ubuntu Linux commands i can never remember

1st September 2022

TimeZone:
timedatectl
timedatectl list-timezones
sudo timedatectl set-timezone your_time_zone
sudo timedatectl set-timezone America/Toronto

Assign all free space to the logical volume:
https://packetpushers.net/ubuntu-extend-your-default-lvm-space/

IPv6 Disable:
sudo nano /etc/sysctl.conf
add following lines:
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
reboot OR sudo sysctl -p

Hostname change: no reboot required, may be Ubuntu only, update DHCP/DNS req reboot
sudo hostnamectl set-hostname new-hostname
verify new hostname:
hostnamectl

If using ufw on a public server; (stop printing informational messages to the console, the overhead can cause network disruption)
nano /etc/sysctl.conf (or a new file like /etc/sysctl.d/99-printk.conf)
kernel.printk = 3 4 1 3 (may just need to un-comment a line near the top that says the same)
*if you don’t want to reboot to apply, run the following
sysctl -w kernel.printk=”3 4 1 3″

journalctl -u tailscaled –since=”37 hours ago” –until=”35 hours ago”
journalctl -u tailscaled –since=”2026-09-13 06:40:00″ –until=”2026-09-13 06:59:00″