开发中遇到的用linux命令,仅此记录
1.删除文件夹中除“test*.txt”的文件find -type f \-! -name "test*.txt" -exec rm {} \; rm -rf `ls | grep -v 'test*.txt'`
2.无须交互为用户设置密码 用户名test01 密码 pass01
echo test01 : pass01 | chpasswd echo ‘pass01’ | passwd --stdin test01