ls -l |more
ls -l | less
cat <fila1 >file2 复制文件作用
ls -l | grep passwd >rightfile 将正确的输出到文件rightfile中
ls -l | grep passwd 2>wongfile 错误的输出到文件中
ls -l | grep passwd &> RightAndWrong 将所有的结果都输出到文件中
ls -l | grep passwd >RightAndWrong 2>&1 与上面的作用一样
> 表示覆盖
>> 表示追加
查找可执行文件路径
which
whereis
先查找alias再查找PATH
locate 关键字
查找带关键字的文件
find [路径] [参数] [表达式]
-user 用户名 ;;;查找uid为用户名的文件
-group
-nouser 查找没有用户的文件
-nogroup
-name filename ;;;查找文件名为filename的文件
-type f 普通文件类型的文件
b block类型的文件
c characteristic类型的文件
l link类型的文件
d directory类型的文件
-perm 6000 查找--S--S---类型的文件
-6000 查找**S**S***类型的文件,相应的位符合,其它位不做要求
+6000 相应的位上至少一个符合要求的文件
-exec command {} /;
{}表示查找到的文件 /表示禁止转意 ;表示结束