[Linux command] touch command option list [Must-see for beginners]

[Linux command] touch command option list [Must-see for beginners]

Summary Linux command list

What is the touch command?

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.

How to use commands

$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

list of touch command options

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

-d option

$ 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

-c option

$ 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

-r option

$ 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

List of options for other Linux commands

pwd, mkdir, cd , cat, cp, ls, touch, less, mv, rm, ssh, man, ** Adding at any time **

Advertising space

We undertake various development and construction contracts and mentor work for beginners. If you are interested, please go to ** here **

Recommended Posts

[Linux command] touch command option list [Must-see for beginners]
[Linux command] cp command option list [Must-see for beginners]
[Linux command] ls command option list [Must-see for beginners]
[Linux command] less command option list [Must-see for beginners]
[Linux command] cat command option list [Must-see for beginners]
[Linux command] pwd command option list [Must-see for beginners]
[Linux command] rm command option list [Must-see for beginners]
[Linux command] cd command option list [Must-see for beginners]
[Linux command] mv command option list [Must-see for beginners]
[Linux command] man command option list [Must-see for beginners]
[Linux command] ssh command option list [Must-see for beginners]
[Linux command] mkdir command option list [Must-see for beginners]
[Linux command summary] Command list [Must-see for beginners]
Linux command memorandum [for beginners]
[Must-see for beginners] Basics of Linux
Linux command list
Linux operation for beginners Basic command summary
Linux command for self-collection
What is Linux? [Command list]
Linux distribution recommended for beginners
Linux Command Dictionary (for myself)
Python #list for super beginners
Convenient Linux shortcuts (for beginners)
Frequently used Linux commands (for beginners)
Linux command # 4
Linux command # 3
Linux command # 5
How to create a shortcut command for LINUX
linux at command
[Linux] Search command
Roadmap for beginners
Linux command <Basic 2>
Linux [directory command]
Linux server command
Linux # Command Memo 1
Linux command [read]
Linux Command Summary
[Basic] linux command
Linux [shell command]
[Linux] Command / Knowledge
pyenv for linux
My linux command
Linux command <Basic 1>
Linux command collection
Linux mkdir command
Linux command basics
[Linux] Git command
Linux (command memory)
[For beginners] How to use say command in python!
[Linux] Basics of authority setting by chmod for beginners