Summary Linux command list
Linux command to change the time stamp. It also has a function to create a new file by specifying a file name that does not exist.
$touch file name
#Make the time stamp of the test file current
$ touch test.txt
#Create a new file by specifying a file name that does not exist
$ touch testoooooooo.txt
option | Description |
---|---|
-d | Specify the date and time |
-c | Do not create a new file |
-r | Match the time stamp of the specified file |
-a | Change only the last access date and time |
-m | Change only the last update date and time |
-h | For symbolic links, change the time stamp of the symbolic itself, not the link destination |
$ touch -d date file name
#File test.Timestamp of txt January 1, 2020 21:Specify 30.
$ touch -d "2020-1-1 21:30" test.txt
$ touch -c file name
#File test.If the txt file does not exist, create a new one, and if it exists, rewrite the time stamp.
$ touch -c test.txt
$ touch -r Existing file name Target file name
#File test.txtのタイムスタンプをFile test2.Make it the same as the txt time stamp.
$ touch -r test2.txt test.txt
pwd, mkdir, cd , cat, cp, ls, touch, less, mv, rm, ssh, man, ** Adding at any time **
We undertake various development and construction contracts and mentor work for beginners. If you are interested, please go to ** here **
Recommended Posts