Files
bobbie-pkm/_Inbox/Linux CLI Config and Commands.md

73 lines
1.0 KiB
Markdown

---
created: 2026-05-15T10:23:05
category:
- "[[Note]]"
title: Linux CLI Config and Commands
tags:
- project
---
### Network config
network config file is located (usually `01-netcfg.yaml` or `50-cloud-init.yaml`)
```
nano /etc/netplan/50-cloud-init.yaml
```
typical config
```
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: false
addresses:
- 192.168.1.100/24
routes:
- to: default
via: 192.168.1.1
```
then try
```
sudo netplan try
```
or apply
```
sudo netplan apply
```
## disk
create gpt partition table (for new drives without any partitions)
```
sudo parted /dev/sdx mklabel gpt
```
create new partition
```
sudo parted -a optimal /dev/sdx mkpart primary ext4 0% 100%
```
format the partition
```
sudo mkfs.ext4 /dev/sdxn
```
mount a drive
```
sudo mount /dev/sdxn /mnt/storage
```
add drive/partition to fstab, get disk UUID first
```
sudo blkid /dev/sdxx
```
Then add this to `/etc/fstab`
```
/dev/disk/by-uuid/your-uuid-here /var/lib/docker ext4 defaults 0 2
```