We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28d0fa3 commit 3df60d1Copy full SHA for 3df60d1
command/date.md
@@ -152,5 +152,19 @@ difference=$(( end - start ))
152
echo $difference seconds.
153
```
154
155
+当你考虑输出带有时间的字符串时,例如(Current time: 2019/05/19):
156
+
157
+最常用的方法:
158
159
+```shell
160
+echo -e "Current time: $(date +"%Y%m%d")"
161
+```
162
163
+另一种方法:
164
165
+suffix='Current time:'
166
+#和echo的用法差不多,注意如果换成单引号就不能替换变量了。
167
+date +"${suffix} %Y/%m/%d"
168
169
170
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
0 commit comments