Day-7 of DevOps

Day-7 of DevOps

Linux System Administration Commands

Linux, as a powerful operating system, offers a wide range of administrative commands that allow system administrators to effectively manage and control their systems. These administrative commands in Linux provide robust control over various aspects of the operating system, including user management, process control, file system management, networking, and security.

1. uname -a:

  • Displays system information, including the operating system, kernel version, hostname, hardware architecture, and more.

2. uptime:

  • Shows how long the system has been running, the current time, the number of users, and the system load averages.

3. whoami:

  • Prints the username of the currently logged-in user.

4. users:

  • Lists the usernames of users currently logged into the system.

5. who:

  • Provides detailed information about users currently logged in, including their usernames, terminal, login time, and IP addresses.

6. w:

  • Displays a summary of the current system activity, including information about users and their activities.

7. id:

  • Shows user and group information for the current user or a specified username.

8. hostnamectl:

  • Prints information about the system hostname and related settings, including the static hostname, icon name, and operating system.

9. free:

  • Displays the amount of free and used system memory (RAM) and swap space.

    • free -m:

      • Displays memory usage in megabytes.

      • The output includes columns for total, used, free, shared, and buffers/cache memory in megabytes.

        free -g:

        • Displays memory usage in gigabytes.

        • Similar to free -m, but the values are presented in gigabytes.

10. lsblk:

  • Lists block devices, including information about partitions and their relationships, along with mount points.

  • 11. df:

    • Displays disk space usage for mounted file systems,Shows information about total space, used space, available space, percentage usage, and mount points

      .

12. df -T:

  • Similar to df, but includes the file system type for each mounted partition, Adds information about the file system type (e.g., ext4) to the df output.

13. df -h:

  • Displays disk space usage in a human-readable format (e.g., in gigabytes and percentages).

  • Provides the same information as df but in a more readable format.

14. du -h:

  • Shows the disk usage of files and directories in the current directory.

  • Displays the disk usage of individual files and directories in the current location in a human-readable format.