Commands
Extend partition size
If the partition size was changed in Proxmox, then after the resize on the UI, restart the VM
- Get PV (Physical Volume) name (Ex: /dev/sda1)
sudo pvs
- Resize the PV
sudo pvresize /dev/sda1
- Get root logical volume name (Filesystem value of / row; for example: /dev/mapper/ubuntu--vg-root)
df -h
- Expand logical volume
sudo lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-root
Source:
Create sudo user
- First create the user:
adduser sammy
- Add user to the sudo group:
usermod -aG sudo sammy
- Then either logout and log back in, or switch to the user:
su - sammy
Source:
Replace text using sed
-
sed -i 's/FIND_TEXT/REPLACE_TEXT/' file.txt