Find out which DNS servers are used by your Linux system:
resolvectl status
Get the IP for a hostname:
nslookup www.apple.com
Find out which DNS servers are used by your Linux system:
resolvectl status
Get the IP for a hostname:
nslookup www.apple.com
ZFS memory management is done by ARC.
arcstat
More details:
arc_summary | more
arc_summary -d | more
List partitions and drives
lsblk
Manipulate partition or list them with:
fdisk -l
Using the disk free command:
df -h
Partition manager utility
parted -l
Get detailed info on hardware, memory, firmware, mainboard, bus
lshw
Relative to mounted drives:
lshw -class disk
Get that information as html (JSON, XML) page:
lshw -class disk -html
List disks by ID, label, UUID…:
ls -l /dev/disk/by-id
ls -l /dev/disk/by-label
ls -l /dev/disk/by-partlabel
ls -l /dev/disk/by-partuuid
ls -l /dev/disk/by-path
ls -l /dev/disk/by-uuid
sfdisk utility for manipulating disk partitions. List block devices:
fsdisk -l
source: https://learnubuntu.com/list-drives/
smartctl -a /dev/nvme0
mkdir /media/usbstick
mount /dev/sdbX /media/usbstick
Delete all files in all folders starting with 2023 living in the current folder
rm -rf 2023*
Check how much memory is used
free -m
ss -ltn
sudo adduser paul
sudo passwd root
Connecting to a server via SSH as root user is disabled by default. To enable this, edit the sshd configuration file:
nano /etc/ssh/sshd_config
Find the following line:
#PermitRootLogin prohibit-password
Change it to this.
PermitRootLogin yes
Now restart the ssh service:
systemctl restart sshd
To check if the server is in the same timezone than your workstation:
date
To modify the time zone:
sudo timedatectl set-timezone Europe/Luxembourg
Change timezone:
dpkg-reconfigure tzdata
sudo apt install unzip
unzip file.zip -d destination_folder
diff -rq /.../folder1 /.../folder2
The r flag assures that each directory is recursively looked at.
The q flag activates the brief mode: without this flag, diff will tell us the actual line-by-line differences for any files that exist in both locations but are not identical.
To check differences between remote shares:
diff -rq /Volumes/Movies-1 /Volumes/Movies-2
This also works with rsync:
rsync -avun $SOURCE $TARGET
In case you want to avoid corrupt files, you want to check for checksums too:
rsync -avnc $SOURCE $TARGET