Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Specify Date and Time as String with Linux Touch Command
#1


    Specify Date and Time as String with Linux Touch Command

   

You can also specify the date and time as a string by using the -d option with the Linux touch command. The following Linux touch command example sets the date to the 8th of March, and the time is automatically set to 00:00:

   
touch -d '8 Mar' file_name.txt
   

Instead of specifying the date as a string, you can select the time as one. In that case, the date will be set to the current date automatically:

   
touch -d '20:10' file_name.txt
   

   

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)