What does Linux touch -d or –date=STRING option do?

You can use touch -d or –date=STRING option to provide a custom timestamp to touch command. By default, touch command uses the current timestamp value.

Example:

Get the current system time

Create a new empty file

List all available files and directories

touch -d option example

List all available files and directories

Observe, the timestamp of myfile changed to “Jan 26 22:30”

Leave a Reply