helpful_ubuntu_commands
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| helpful_ubuntu_commands [2026/08/08 20:15] – mike | helpful_ubuntu_commands [2026/09/02 19:57] (current) – mike | ||
|---|---|---|---|
| Line 45: | Line 45: | ||
| === Copy an existing partition to a new partition === | === Copy an existing partition to a new partition === | ||
| sudo rsync -aAXv --info=progress2 --exclude='/ | sudo rsync -aAXv --info=progress2 --exclude='/ | ||
| + | | ||
| + | === Copy a directory and all its subdirs to another directory === | ||
| + | rsync -av / | ||
| === Finding largest files/ | === Finding largest files/ | ||
| Line 79: | Line 82: | ||
| ==== Ansible/ | ==== Ansible/ | ||
| | | ||
| - | === Generate password hashes (useful for Ansible playbooks amongst other things) === | + | === Generate password hashes (useful for Ansible playbooks, Ansible Vault, |
| mkpasswd --method=sha-512 | mkpasswd --method=sha-512 | ||
| Line 131: | Line 134: | ||
| sudo netplan apply | sudo netplan apply | ||
| | | ||
| + | Update the /etc/hosts file accordingly | ||
| + | |||
| + | === Changing the server' | ||
| + | |||
| + | 1. Disable cloud-init networking to avoid overwriting the new configuration: | ||
| + | echo " | ||
| + | |||
| + | 2. cd into / | ||
| + | |||
| + | network: | ||
| + | version: 2 | ||
| + | renderer: networkd | ||
| + | ethernets: | ||
| + | ens18: | ||
| + | dhcp4: false | ||
| + | addresses: | ||
| + | - 192.168.1.xx/ | ||
| + | nameservers: | ||
| + | addresses: | ||
| + | - 192.168.1.1 | ||
| + | routes: | ||
| + | - to: default | ||
| + | via: 192.168.1.1 | ||
| + | |||
| + | 3. Execute '' | ||
| + | |||
| === Changing the server' | === Changing the server' | ||
| hostnamectl set-hostname [new host name] | hostnamectl set-hostname [new host name] | ||
helpful_ubuntu_commands.1786245316.txt.gz · Last modified: by mike
