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

How to use the touch command on Linux system

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Editor to share with you how to use the touch command of the Linux system. I hope you will get something after reading this article. Let's discuss it together.

In Linux systems, the touch command is often used to create a new file, but another function of the touch command is to update the time tags of existing files to the current time of the system (the default), and their data will remain intact.

Touch common command parameters-a change only the access time-c,-- no-create do not create any files-d,-- date=STRING parse STRING and use it instead of current time-f (ignored)-h -no-dereference affect each symbolic link instead of any referenced file (useful only on systems that can change the timestamps of a symlink)-m change only the modification time-r -- reference=FILE use this file's times instead of current time-t STAMP use [[CC] YY] MMDDhhmm [.ss] instead of current time-- time=WORD change the specified time: WORD is access, atime Or use: equivalent to-a WORD is modify or mtime: equivalent to-m-- help display this help and exit-- version output version information and exit commonly used commands display touch: create 10 files of file1-file10

Touch``file`` {1.. 10} set the timestamp of the file

Touch-t 201810121230 hh.sh [- t in decimal number]

The time to update log.log is the same as the log2012.log timestamp

Touch``-r hh hh.sh [``touch``-r target file source file]

After reading this article, I believe you have a certain understanding of "how to use touch commands in Linux system". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

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

Development

Wechat

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

12
Report