linux命令

开发中遇到的用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

posted @ 2013-12-16 22:05  风禾  阅读(123)  评论(0编辑  收藏  举报