1. whoami
Purpose
The whoami command displays the username of the currently logged-in Linux user.
How it works
When the command is executed, Linux checks the current user's login session and prints the username associated with that session.
Why do we use it?
• To identify the current logged-in user.
• To verify which user account is executing commands.
• Useful when switching between multiple users or checking administrator (root) access.
Command
whoami
My Output
abisha_berci
Explanation of Output:
The current logged-in Linux user is abisha_berci.
2. hostname
Purpose
The hostname command displays the name of the Linux computer or server.
How it works
Every Linux system has a unique hostname stored in its configuration. The command reads this value and displays it.
Why do we use it?
• To identify the system or server.
• Useful for managing multiple servers in a network.
• Helps in remote administration and troubleshooting.
Command
hostname
My Output
LAPTOP-R7DDAKUB
Explanation of Output:
The hostname of my Linux system is LAPTOP-R7DDAKUB.
3. uptime
Purpose
The uptime command shows how long the Linux system has been running since the last boot.
How it works
Linux records the system boot time. When uptime is executed, it calculates the difference between the current time and the boot time.
Why do we use it?
• To check system availability.
• To know how long the server has been running without restarting.
• To monitor system workload using load averages.
Command
uptime
My Output
06:30:28 up 1:01, 0 users, load average: 0.02, 0.04, 0.02
Explanation of Output:
• 06:30:28 → Current system time.
• up 1:01 → The Linux system has been running for 1 hour and 1 minute.
• 0 users → No active users are currently logged in.
• load average → Shows the CPU workload over the last 1, 5, and 15 minutes. Lower values indicate the system is not busy.
4. df -h
Purpose
The df (Disk Free) command displays information about the file system and available disk space.
How it works
Linux checks each mounted file system and reports its total size, used space, available space, and usage percentage.
Why do we use it?
• To monitor disk usage.
• To check available storage.
• To prevent storage from becoming full.
• Useful for system maintenance and troubleshooting.
Command
df -h
Meaning of -h
The -h option means human-readable, so the sizes are displayed in MB, GB, or TB instead of bytes.
My Output (Main Filesystem)
/dev/sde 1007G 1.3G 955G 1% /
Explanation of Output:
• Filesystem: /dev/sde – The storage device.
• Size: 1007G – Total disk capacity.
• Used: 1.3G – Disk space currently used.
• Available: 955G – Free disk space.
• Use%: 1% – Percentage of storage currently used.
• Mounted on: / – Root directory of the Linux file system.
I successfully executed and verified the following commands and I have attached the screenshot showing the command outputs for verification.

Top comments (0)