From a8129437eb37816fdbed02733a6705b0f78e0d90 Mon Sep 17 00:00:00 2001 From: ZhuangZhu-74 <49544524+ZhuangZhu-74@users.noreply.github.com> Date: Fri, 24 May 2019 15:13:27 +0800 Subject: [PATCH] Update sed.md date.md (#109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update date.md 修复了我自己之前更新时引入的错误 * Update sed.md 修正markdown格式 --- command/date.md | 2 +- command/sed.md | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/command/date.md b/command/date.md index a182904c6c..f0ee7267be 100644 --- a/command/date.md +++ b/command/date.md @@ -157,7 +157,7 @@ echo $difference seconds. 最常用的方法: ```shell -echo -e "Current time: $(date +"%Y%m%d")" +echo "Current time: $(date +"%Y/%m/%d")" ``` 另一种方法: diff --git a/command/sed.md b/command/sed.md index bad5113bda..84f0a66109 100644 --- a/command/sed.md +++ b/command/sed.md @@ -373,16 +373,14 @@ sed [options] -f scriptfile file(s) ```shell sed -n 'p;n' test.txt #奇数行 sed -n 'n;p' test.txt #偶数行 - -```shell +``` 方法2: ```shell sed -n '1~2p' test.txt #奇数行 sed -n '2~2p' test.txt #偶数行 - -```shell +``` ### 打印匹配字符串的下一行 @@ -390,8 +388,7 @@ sed -n '2~2p' test.txt #偶数行 grep -A 1 SCC URFILE sed -n '/SCC/{n;p}' URFILE awk '/SCC/{getline; print}' URFILE - -```shell +```