1
0
mirror of https://github.com/jlevy/the-art-of-command-line.git synced 2024-12-12 10:45:00 +02:00

Update README-zh-Hant.md

add missing space
This commit is contained in:
Aron yu 2021-01-14 22:16:29 +08:00 committed by GitHub
parent f79f79cfe6
commit f1cdc672ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -297,8 +297,8 @@ mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir
- 當你需要對文字檔案做集合交、並、差運算時,結合使用`sort`/`uniq` 很有幫助。假設 `a``b` 是兩內容不同的檔案。這種方式效率很高,並且在小檔案和上G的檔案上都能運用(`sort` 不被記憶體大小約束,儘管在`/tmp` 在一個小的根分區上時你可能需要`-T ` 參數),參閱前文中關於`LC_ALL` 和`sort` 的`-u` 參數的部分。
```sh
      cat a b | sort | uniq > c # c is a union b
      cat ab | sort | uniq -d > c # c is a intersect b
      cat abb | sort | uniq -u > c # c is set difference a - b
      cat a b | sort | uniq -d > c # c is a intersect b
      cat a b b | sort | uniq -u > c # c is set difference a - b
```
- 使用`grep . *`(每行都會附上檔名)或者`head -100 *`(每個檔案有一個標題)來閱讀檢查目錄下所有檔案的內容。這在檢查一個充滿配置檔案的目錄(如`/sys`、`/proc`、`/etc`)時特別好用。