1. 程式人生 > >Redhat 和 Ubuntu 命令對比

Redhat 和 Ubuntu 命令對比

Redhat 和 Ubuntu 命令對比

目錄

文章目錄

非互動模式修改root密碼

Ubuntu 下
[email protected]:~# echo "root:newpassword" | chpasswd

Redhat 下
[[email protected] ~]# echo "newpassword" | passwd --stdin root

檢視軟體包是否已經安裝

Ubuntu下
[email protected]:~# dpkg -l | grep mysql

Redhat下
[[email protected] ~]# rpm -qa | grep mysql

使用者和組(新增、刪除使用者)

Ubuntu下
groupadd -g 999 git
useradd -r -m -u 999 -g git -s /bin/bash git
id git

Redhat下
groupadd -g 999 git
useradd -r -m -u 999 -g 999 -s /bin/bash git        
注:-r:系統賬戶;-m:建立home目錄
userdel -r -f git   
注:-r:移除home目錄;-f:強制刪除

引用說明:
https://blog.csdn.net/u010000716/article/details/50075249