Command | Description | Syntax | Example |
---|---|---|---|
uname -a | Display system information | uname -a | Darwin MacBook-Pro.local 20.2.0 Darwin Kernel Version 20.2.0: Fri Nov 13 20:45:48 PST 2020; root:xnu-7 |
df -h | Display free disk space | df -h | Filesystem Size Used Avail Use% Mounted on <br> /dev/sda1 30G 5.4G 24G 19% / |
du -sh <directory> | Display the size of a directory | du -sh /etc/ | 4.0K /etc/ |
free -m | Display free and used memory | free -m | total used free shared buff/cache available <br> Mem: 7805 633 4716 13 855 6905 |
top | Display the system processes | top | top – 13:14:21 up 4:37, 2 users, load average: 0.08, 0.09, 0.10 |
ps -ef | Display the process hierarchy | ps -ef | UID PID PPID C STIME TTY TIME CMD <br> root 1 0 0 Feb06 ? 00:00:01 /sbin/init |
uptime | Display the system uptime | uptime | 13:15:01 up 4:38, 2 users, load average: 0.08, 0.09, 0.10 |
ifconfig | Display network interface configuration | ifconfig | eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 <br> inet 192.168.0.100 netmask 255.255.255.0 broadcast 192.168.0.255 |
ip addr show | Display network interface configuration | ip addr show | 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 <br> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 <br> inet 127.0.0.1/8 scope host lo <br> valid_lft forever preferred_lft forever |
Note: The output of these commands may vary based on the Unix-based operating system you are using (e.g. Linux, macOS, etc.).