### BEGIN: Piples ###ps aux | grep nethack | wc -l### BEGIN: xargs ###find / -name '*.txt' -size +10K -user ronnie -not -perm /o=r -exec chmod o+r {} \; # CMD1find / -name '*.txt' -size +10K -user ronnie -not -perm /o=r | xargs chmod o+r # CMD2# CMD2 比 CMD1 更简洁,并且速度更快,因为所有匹配的文件一次性的传给了 chmod。# xargs -l # each line# -p # prompt you before executing each command.### END: xargs ###### END: Piples ###### BEGIN: Boolean Operators ###cmd1 && cmd2 # cmd1 执行成功(exit status = 0)之后才会执行 cmd2cmd1 || cmd2 # cmd1 执行失败(exit status = 1)之后才会执行 cmd2### END: Boolean Operators ###### BEGIN: ; ###cmd1 ; cmd2 ; cmd3 # 顺序执行 cmd1-3,无论成功与否 ### END: ; ###### BEGIN: Process Substitution ###cat <(ls -al) # 效果同 ls -al | catdiff <(ls dir1) <(ls dir2) # 效果同下# ls dir1 > file1.txt# ls dir2 > file2.txt# diff file1.txt file2.txt### END: Process Substitution ###