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

What is the touch command in linux

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces what is the touch command in linux, which can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

The linux touch command explains:

1. Command function:

Timestamps for creating files and modifying files or directories

2. Command syntax:

Touch [option] [file name or directory name]

3. Command parameters:

-a modify only the access (access) time of the file.

-c or-- no-create does not create files that do not exist.

-d uses the specified date time instead of the current time

-m refers to the modified Modify time, but not the access time

-r file updates the timestamp of the specified file file with the timestamp (access,modify) of the file (access,modify)

Note: access indicates the time when the file was last accessed (only access, no changes)

Modify indicates the time when the file was last modified

Change indicates the time when the file properties were last changed, including permissions, size, attributes, etc.

-t change the time to the date specified by the parameter, for example: 07081556 represents 15:56 on July 8th

4. Examples of use:

Create files that do not exist, such as under the / data directory:

Modify the access (access) time of the file, such as the access time of the westoslinux in the figure above

Modify (modification) time of a modified file, such as modify time of a modified / data/westoslinux file

Use the specified time to change the access or modify time of a file or directory. For example, to modify the access time of the file in the figure above is 2012-07-15 08:30:30, you only need to change the parameter a to m to modify the modify timestamp.

Thank you for reading this article carefully. I hope it is helpful for everyone to share the touch command in linux. At the same time, I also hope you can support us, pay attention to the industry information channel, and find out if you have any problems. Detailed solutions are waiting for you to learn!

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