Guest User

Untitled

a guest
Feb 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. # 去除文档中的重复行
  2. ```bash
  3. awk '{if (!seen[$0]) print $0; seen[$0]=$0}' test.txt
  4. ```
  5.  
  6. ---
  7.  
  8. # 查找当前目录下的空文件
  9. ```bash
  10. for i in `ls -1s | awk '{if ($1==0) print $2}'`; do echo $i; done;
  11. ```
  12. 以下这行功能与上面一致,只是变量表示方式不同:
  13. ```bash
  14. for i in $(ls -1s | awk '{if ($1==0) print $2}'); do echo $i; done;
  15. ```
Add Comment
Please, Sign In to add comment