在CentOS Minimal中,有许多基本命令可以帮助你进行系统管理和日常操作。以下是一些常用的基本命令:
系统管理
sudo yum updatesudo yum install package_namesudo yum remove package_name用户管理
sudo useradd usernamessudo userdel -r username文件操作
ls -lahcd /path/to/directorycp source_file destinationmv source_file destinationrm -rf file_or_directory权限管理
chmod 755 file_or_directorychown user:group file_or_directory网络配置
ip addr/etc/sysconfig/network-scripts/ifcfg-eth0,设定静态IP地址。
BOOTPROTO=static
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
date防火墙设置
sudo systemctl start firewalldsudo firewall-cmd --permanent --add-port=80/tcpsudo firewall-cmd --reloadSELinux管理
getenforcesudo setenforce 0sudo vi /etc/selinux/config,将 SELINUX=enforcing 改为 SELINUX=permissive。这些命令涵盖了系统管理、用户管理、文件操作、权限管理、网络配置、防火墙设置和SELinux管理等方面,是CentOS Minimal日常管理和维护中必不可少的基本工具。