Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Create a file at the current time

2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

View the current time:

[root@master1-192,168117-18] # date "+% y-%m-%d% H:%M:%S"

19-12-17 10:30:44

Create a file at the current time:

[root@master1-192,168117-18] # touch date +% Y%m%d.doc

[root@master1-192,168117-18] # ls-l

Total dosage 8

Drwxr-xr-x 2 root root 4096 December 17 10:21 20191217

-rw-r--r-- 1 root root 0 December 17 10:32 20191217.doc

-rw-. 1 root root 1573 November 7 11:22 anaconda-ks.cfg

Create a folder at the current time:

[root@master1-192,168117-18] # mkdir date +% Y%m%d

[root@master1-192,168117-18] # ls-l

Total dosage 8

Drwxr-xr-x 2 root root 4096 December 17 10:21 20191217

-rw-r--r-- 1 root root 0 December 17 10:32 20191217.doc

-rw-. 1 root root 1573 November 7 11:22 anaconda-ks.cfg

Define a time variable

[root@master1-192,168117-18] # time=date +% Y%m%d

[root@master1-192,168117-18] # echo $time

20191217

[root@master1-192,168117-18] # mkdir $time

[root@master1-192,168117-18] # touch $time.txt

[root@master1-192,168117-18] # ls-l

Total dosage 8

Drwxr-xr-x 2 root root 4096 December 17 11:44 20191217

-rw-r--r-- 1 root root 0 December 17 11:45 20191217.txt

-rw-. 1 root root 1573 November 7 11:22 anaconda-ks.cfg

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report