linux-administration

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Linux Administration

Linux 系统管理

Core Linux system administration skills.
Linux系统管理核心技能。

Package Management

软件包管理

bash
undefined
bash
undefined

Debian/Ubuntu

Debian/Ubuntu

apt update && apt upgrade -y apt install nginx apt remove nginx apt autoremove
apt update && apt upgrade -y apt install nginx apt remove nginx apt autoremove

RHEL/CentOS

RHEL/CentOS

dnf update dnf install nginx dnf remove nginx
undefined
dnf update dnf install nginx dnf remove nginx
undefined

System Information

系统信息

bash
uname -a           # Kernel info
hostnamectl        # System info
lscpu              # CPU info
free -h            # Memory usage
df -h              # Disk usage
ip addr            # Network interfaces
bash
uname -a           # 内核信息
hostnamectl        # 系统信息
lscpu              # CPU信息
free -h            # 内存使用情况
df -h              # 磁盘使用情况
ip addr            # 网络接口

Log Management

日志管理

bash
journalctl -u nginx          # Service logs
journalctl -f                # Follow logs
tail -f /var/log/syslog      # System logs
dmesg                        # Kernel messages
bash
journalctl -u nginx          # 服务日志
journalctl -f                # 实时跟踪日志
tail -f /var/log/syslog      # 系统日志
dmesg                        # 内核消息

Process Management

进程管理

bash
ps aux | grep nginx
top / htop
kill -9 <pid>
pgrep nginx
pkill nginx
bash
ps aux | grep nginx
top / htop
kill -9 <pid>
pgrep nginx
pkill nginx

Best Practices

最佳实践

  • Regular updates
  • Minimal installed packages
  • Proper file permissions
  • Log rotation configuration
  • Automated backups
  • 定期更新
  • 最小化已安装软件包
  • 正确设置文件权限
  • 配置日志轮转
  • 自动化备份