In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you the use of linux touch command to create files, I believe that most people do not know much, so share this article for you to learn, I hope you will learn a lot after reading this article, let's go to learn the method!
The touch command has two functions: one is to create a new empty file, and the other is to change the timestamp attribute of an existing file.
The touch command updates the access time and modification time of the specified file based on the current system time. If the file does not exist, a new empty file will be created unless the "- c" or "- h" options are specified.
Note: when modifying the time attribute of a file, the user must be the owner of the file or have access to write to the file.
Syntax format: touch [parameters] [file]
Commonly used parameters: coach
-a change the read time record of the file-m change the modification time record of the file-r use the time record of the reference file, the effect is the same as-- file-c does not create a new file-d set the time and date, you can use a variety of different formats-t to set the time record of the file, the format is the same as the date command-- no-create does not create new files-- help displays help information
-- version lists version messages
Reference example
Create an empty file:
[root@linuxcool ~] # touch file.txt
Create files in bulk:
[root@linuxcool ~] # touch file {1.. 5} .txt
[root@linuxcool ~] # ls
File1.txt file2.txt file3.txt file4.txt file5.txt
Modify the access (access) time of the file:
[root@linuxcool ~] # stat file.txt
File: file.txt
Size: 0 Blocks: 0 IO Block: 512 regular empty file
Device: 2h/2d Inode: 87538717757135273 Links: 1
Access: (0666) Uid: (1000 / root) Gid: (1000 / root)
Access: 2019-04-07 00 purl 25 purl 34.729216500 + 0800
Modify: 2019-04-07 00 purl 25 purl 34.729216500 + 0800
Change: 2019-04-07 00 purl 25 purl 34.729216500 + 0800
Birth:-
[root@linuxcool] # touch-a file.txt
[root@linuxcool ~] # stat file.txt
File: file.txt
Size: 0 Blocks: 0 IO Block: 512 regular empty file
Device: 2h/2d Inode: 87538717757135273 Links: 1
Access: (0666) Uid: (1000 / root) Gid: (1000 / root)
Access: 2019-04-07 0026 Vera 13.004116000 + 0800
Modify: 2019-04-07 00 purl 25 purl 34.729216500 + 0800
Change: 2019-04-07 0026 Vera 13.004116000 + 0800
Birth:-the above is all the contents of the file created using linux's touch command, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.