Linux System Management Commands
uname: View system kernel informationlsb_release: View Linux distribution informationcat /etc/os-release: View detailed system distribution informationlscpu: View CPU informationfree: View memory usage statisticssystemctl: Manage service startup, shutdown, status checking, etc.service: Manage service startup, shutdown, status checking, etc.ps: View currently running processestop: Monitor system processes in real-timekill: Terminate a processnice: Set process priorityyum(CentOS/RHEL): Manage software package installation, updates, and removalsapt-get(Ubuntu/Debian): Manage software package installation, updates, and removalsrpm: Manage RPM packages
Detailed Introduction
Common Linux system management commands:
uname: Used to display basic information about the current system, including operating system name, kernel version, hardware architecture, etc.- Common options:
uname -s: Display the operating system nameuname -r: Display the kernel versionuname -m: Display the hardware architecture
- Common options:
lsb_release: Used to display detailed information about the Linux distribution.- Common options:
lsb_release -a: Display all distribution informationlsb_release -d: Display the distribution descriptionlsb_release -c: Display the distribution codename
- Common options:
cat /etc/os-release: Used to directly view the/etc/os-releasefile and obtain detailed system distribution information.lscpu: Used to display detailed CPU information, including processor model, number of cores, threads per core, clock speed, etc.free: Used to display memory usage statistics for the system, including total memory, used memory, available memory, and more.- Common options:
free -h: Display memory usage in a human-readable format
- Common options:
systemctl: Used to manage service startup, shutdown, status checking, etc.- Common commands:
systemctl start <service_name>: Start the specified servicesystemctl stop <service_name>: Stop the specified servicesystemctl status <service_name>: Check the status of the specified service
- Common commands:
service: Used to manage service startup, shutdown, and status checking; functionality is similar to thesystemctlcommand.ps: Used to display information about processes currently running on the system.- Common options:
ps -ef: Display detailed information for all processesps aux: Display all processes from a user's perspective
- Common options:
top: Used to monitor the runtime status of system processes in real-time; allows viewing usage statistics for CPU, memory, and other system resources.kill: Used to terminate specified processes.- Common options:
kill <PID>: Terminate a process via its Process ID (PID)kill -9 <PID>: Forcefully terminate a process
- Common options:
nice: Used to adjust the priority of a process; can increase or decrease the CPU weight usage for that process.yum(CentOS/RHEL) andapt-get(Ubuntu/Debian): Used to manage software package installation, updates, and removals.rpm: Used to manage RPM packages; suitable for RPM-based distributions such as CentOS/RHEL.