Skip to content

Linux System and Disk Commands for DevOps Engineers

โ† Back to Linux Commands


In this section, you will learn basic system, memory, disk, and navigation commands commonly used by DevOps engineers while monitoring servers and troubleshooting production issues.


free โ€“ Check Memory Usage

Used to check RAM / memory usage on a Linux server.

By default, the free command shows memory usage in kilobytes (KB).

ubuntu@manikandan:~$ free
               total        used        free      shared  buff/cache   available
Mem:          987264      334996       85924        1304      566344      472600
Swap:              0           0           0

free -h (Human Readable)

The -h option displays memory usage in MB or GB.

ubuntu@manikandan:~$ free -h
               total        used        free      shared  buff/cache   available
Mem:           964Mi       327Mi        82Mi       1.0Mi       553Mi       461Mi
Swap:             0B          0B          0B

df โ€“ Check Disk Usage

Used to check disk usage on a Linux server.

By default, df displays disk usage in kilobytes (KB).

ubuntu@manikandan:~$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
tmpfs              98728    1276     97452   2% /run
/dev/sda1       47143192 7437908  39688900  16% /
tmpfs             493632       0    493632   0% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
/dev/sda15        106858    6182    100677   6% /boot/efi
tmpfs              98724       4     98720   1% /run/user/1001

df -h (Human Readable)

ubuntu@manikandan:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs            97M  1.3M   96M   2% /run
/dev/sda1        45G  7.1G   38G  16% /
tmpfs           483M     0  483M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda15      105M  6.1M   99M   6% /boot/efi
tmpfs            97M  4.0K   97M   1% /run/user/1001

Other Common Linux Utility Commands

which

Find the location of a command.

which kubectl

man

View the manual page of a command.

man df

id

Display user and group information.

id

hostname

Check the system hostname.

hostname

Directory Navigation Shortcuts

  • cd .. โ†’ Move one directory up
  • cd ../.. โ†’ Move two directories up
  • cd โ†’ Go to home directory
  • cd ~ โ†’ Go to home directory explicitly
  • cd - โ†’ Switch to previous directory

Practice Tasks

  1. Check memory usage using free and free -h
  2. Check disk usage using df -h
  3. Identify which partition is mounted on /
  4. Check the hostname of your server
  5. Switch between two directories using cd -

๐Ÿง  Quick Quiz โ€“ System Basics

#

Which command shows disk usage in a human-readable format?


๐Ÿ“ Want More Practice?

To strengthen your understanding and prepare for interviews, try the full 20-question practice quiz based on this chapter:

๐Ÿ‘‰ Start System & Disk Commands Quiz (20 Questions)


๐Ÿ“ฌ DevopsPilot Weekly โ€” Learn DevOps, Cloud & Gen AI the simple way.
๐Ÿ‘‰ Subscribe here