Linux Sysadmin Commands Guide

Linux Sysadmin Commands Guide Introduction As a Linux system administrator, mastering essential commands is crucial for managing servers, monitoring systems, and troubleshooting issues. This guide covers fundamental Linux commands for system administration, focusing on user management, process control, network diagnostics, and system monitoring, with practical examples. Prerequisites A Linux system (e.g., Ubuntu, CentOS, or Debian). Root or sudo privileges. Basic familiarity with the terminal. System Information Hardware and System Overview # Display system information uname -a # Show CPU details lscpu cat /proc/cpuinfo # Display memory usage free -h cat /proc/meminfo # List block devices (disks) lsblk fdisk -l # Requires sudo # Show mounted filesystems df -h System Uptime and Load # Display system uptime and load average uptime # Show load average cat /proc/loadavg # Interactive system monitoring top htop # If installed User and Group Management Managing Users # Add a new user sudo useradd -m -s /bin/bash username # Set a password for the user sudo passwd username # Modify user details sudo usermod -aG groupname username # Add user to a group sudo usermod -s /bin/zsh username # Change shell # Delete a user sudo userdel -r username # Remove user and home directory Managing Groups # Create a new group sudo groupadd groupname # Add user to a group sudo usermod -aG groupname username # List groups getent group # Delete a group sudo groupdel groupname Example: Creating a User with Specific Permissions Create a user devuser with sudo privileges: ...

September 26, 2025 · 6 min · 1066 words · Manzolo