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 +```