Check System Layout
After setting up a new Linux machine, at least you need to understand the layout. Including the CPU, memory, disk, and network. You can check the server layout by running:
Green="\033[32m"
Blue="\033[36m"
Font="\033[0m"
OK="${Green}[ OK ]${Font}"
function print() {
echo -e "${OK} ${Blue} $1 ${Font}"
}
print "OS information"
sudo lsb_release -a
print "OS install date"
stat -c %w /
print "Secure Boot status"
sudo mokutil --sb-state
print "Root file system"
sudo df -Th /
print "Boot mode"
if [ -d /sys/firmware/efi ]; then echo "Boot mode: UEFI"; else echo "Boot mode: Legacy"; fi
print "CPU information"
sudo lscpu
print "PCIE information"
sudo lspci
print "USB information"
sudo lsusb
print "Disk layout"
sudo lsblk
print "All disks information"
sudo fdisk -l
print "Disk usage"
sudo df -Th
print "Memory information"
sudo free -h
print "Network information"
sudo ip link show
print "Firewall status"
sudo ufw status
print "Network location"
curl https://ipinfo.io
Find OS Installation Date
To find the OS install time on AnduinOS, you can use the stat
command:
stat /
And you can filter the Birth
field to get the OS install time:
stat / | grep Birth
Or even simpler, you can run:
stat -c %w /
That's it!
Check Secure Boot Status
To check the Secure Boot status on AnduinOS, you can use the mokutil
command:
sudo mokutil --sb-state
You can also check the signature database status:
sudo mkutil --list-enrolled
Check Root File System
To check the root file system on AnduinOS, you can use the df
command:
sudo df -Th /
Check Boot Mode
To check the boot mode on AnduinOS, you can use the following command:
if [ -d /sys/firmware/efi ]; then echo "Boot mode: UEFI"; else echo "Boot mode: Legacy"; fi
Check CPU Information
To check the CPU information on AnduinOS, you can use the lscpu
command:
sudo lscpu
Check PCIE devices
To check the PCIE devices on AnduinOS, you can use the lspci
command:
sudo lspci
Check USB devices
To check the USB devices on AnduinOS, you can use the lsusb
command:
sudo lsusb
Check Disk Layout
To check the disk layout on AnduinOS, you can use the lsblk
command:
sudo lsblk
Which will output all mounted disks and partitions.
To also check all available disks, you can use the fdisk
command:
sudo fdisk -l
To know the file system and disk usage, you can use the df
command:
sudo df -Th
You can also use df
to check a specific folder:
sudo df -Th /path/to/folder
Check Memory Information
To check the memory information on AnduinOS, you can use the free
command:
sudo free -h
To check memory usage in real-time, you can use the watch
command:
watch -n 1 free -h
To check all processes and their memory usage, you can use the top
command:
top -o %MEM
Check Network Information
By default, AnduinOS use NetworkManager to manage network connections.
To check the NetworkManager status, you can use the systemctl
command:
sudo systemctl status NetworkManager
To edit the NetworkManager configuration, you can use the nmcli
command:
sudo nmcli connection edit connection_name
Or even easier, simply use gnome-control-center
:
To check the network information on AnduinOS, you can use the ip
command:
sudo ip link show
Check Firewall Status
To check the firewall status on AnduinOS, you can use the ufw
command:
sudo ufw status
To allow a specific port, you can use the ufw
command:
sudo ufw allow 80
To view all rules, you can use the ufw
command:
sudo ufw status numbered
To remove a specific rule, you can use the ufw
command:
sudo ufw delete 1
Check Network Location
To check the network location on AnduinOS, you can use the ipinfo
command:
curl https://ipinfo.io