From 435a1f6644164d1fc89933226d48177cc86e9608 Mon Sep 17 00:00:00 2001 From: reiscigit <44085121+reiscigit@users.noreply.github.com> Date: Sat, 20 Oct 2018 00:03:40 +0800 Subject: [PATCH 1/3] zh-Hant: Update iconv and uconv example --- README-zh-Hant.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README-zh-Hant.md b/README-zh-Hant.md index 8786e2f..be202cf 100644 --- a/README-zh-Hant.md +++ b/README-zh-Hant.md @@ -233,9 +233,13 @@ mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir - 二進制檔案對比(Delta 壓縮),使用`xdelta3`。 -- 使用 `iconv` 更改文字編碼。而更高階的用法,可以使用`uconv`,它支援一些高階的Unicode 功能。例如,這條命令將所有母音字母轉為小寫並移除了: +- 轉換文字編碼可使用 `iconv` 或 `uconv`,後者支援 Unicode 相關的進階用法。例如: ```sh -      uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt + # 顯示十六進制碼或字元標準名稱(有益於除錯) + uconv -f utf-8 -t utf-8 -x '::Any-Hex;' < input.txt + uconv -f utf-8 -t utf-8 -x '::Any-Name;' < input.txt + # 將文字轉換為小寫並移除所有重音標記(展開字元並移除標記): + uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC;' < input.txt > output.txt ``` - 拆分檔案,檢視`split`(按大小拆分)和`csplit`(按模式拆分)。 From 3d8afef22ed748be5cae1eb652e81fdab71ab927 Mon Sep 17 00:00:00 2001 From: Joshua Levy Date: Thu, 23 May 2019 10:14:40 -0700 Subject: [PATCH 2/3] Note about soliciting an author. --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 06ceae8..77d2444 100755 --- a/README.md +++ b/README.md @@ -4,10 +4,7 @@ # The Art of Command Line -[![Ask a Question](https://img.shields.io/badge/%3f-Ask%20a%20Question-ff69b4.svg)](https://airtable.com/shrzMhx00YiIVAWJg) - -[![Join the chat at https://gitter.im/jlevy/the-art-of-command-line](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jlevy/the-art-of-command-line?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - +*Note: I'm looking for a new (and potentially paid) lead author to help expand this to a more comprehensive Guide. While it's very popoular, it could be both deeper and more helpful. If you like to write and are close to being an expert on this material and willing to consider helping, please drop me a note at josh (0x40) holloway.com. –[jlevy](https://github.com/jlevy), [Holloway](https://www.holloway.com)* - [Meta](#meta) - [Basics](#basics) From 84482aa24dd6c3af62a2f64977e6cd22d918684f Mon Sep 17 00:00:00 2001 From: Joshua Levy Date: Mon, 27 May 2019 15:27:37 -0700 Subject: [PATCH 3/3] One-liner to show colored, normalized JSON diffs. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 77d2444..ff73938 100755 --- a/README.md +++ b/README.md @@ -364,6 +364,11 @@ A few examples of piecing together commands: sort a b b | uniq -u > c # c is set difference a - b ``` +- Pretty-print two JSON files, normalizing their syntax, then coloring and paginating the result: +``` + diff <(jq --sort-keys . < file1.json) <(jq --sort-keys . < file2.json) | colordiff | less -R +``` + - Use `grep . *` to quickly examine the contents of all files in a directory (so each line is paired with the filename), or `head -100 *` (so each file has a heading). This can be useful for directories filled with config settings like those in `/sys`, `/proc`, `/etc`.