Back to blog

Linux Best Practices

Frequently used Linux system commands and good practices: CPU, memory, disk, user, and port management.
linux

CPU

lscpu
cat /proc/cpuinfo

Memory Usage

free
cat /proc/meminfo
top
htop

Disk Usage

df -h
du -h

OS Check

cat /etc/os-release
cat /etc/system-release
lsb_release -a
sw_vers

Users

w
who
users
cat /etc/passwd

Groups

cat /etc/group

Change Password

passwd

Port Check

netstat -ant

Change Directory

CommandDescription
cd /path/to/you/want/to/goChanges to the directory you want
cd -Changes to the directory you were in before