码迷,mamicode.com
首页 > 系统相关 > 详细

linux基础篇-13,命令替换$()

时间:2016-11-23 08:33:15      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:linux   file   touch   

[root@localhost ~]# echo it is the time $(clock)

it is the time 2016年11月10日 星期四 18时20分38秒 -0.327027 seconds


命令替换

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# touch ./file-$(date +%F-%H-%M-%S).txt

[root@localhost ~]# ll ./

总用量 44


-rw-r--r--. 1 root root     0 11月 10 14:34 201711201500

-rw-------. 1 root root  1367 7月  20 00:30 anaconda-ks.cfg

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-04.txt

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-05.txt

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-06.txt

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-07.txt

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-08.txt

-rw-r--r--. 1 root root     0 11月 10 18:26 file-2016-11-10-18-26-09.txt

-rw-r--r--. 1 root root     0 11月 10 18:25 file-.txt

-rw-r--r--. 1 root root 27828 7月  20 00:30 install.log

-rw-r--r--. 1 root root  7572 7月  20 00:28 install.log.syslog


本文出自 “James zhan Linux高级运维” 博客,请务必保留此出处http://jameszhan.blog.51cto.com/10980469/1875542

linux基础篇-13,命令替换$()

标签:linux   file   touch   

原文地址:http://jameszhan.blog.51cto.com/10980469/1875542

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!