Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set Specific Access and Modification Time Using Linux Touch Command
#1

  Set Specific Access and Modification Time
 

Set Specific Access and Modification Time



 

You can also set a file's access and modification time to a specific date by using the t option followed by a date-time. It would look like this:


 
touch -t 202203081047.30 file_name.txt

 

Make sure to check whether the date changed with the following command:


 
ls -lu file_name.txt

 

 

Remember that the date-time format must follow the CCYYMMDDhhmm.ss style:


 
       
  • CC – the first two digits of the year
  •    
  • YY – the second two digits of the year
  •    
  • MM – the month of the year (01-12)
  •    
  • DD – the day of the month (01-31)
  •    
  • hh – the hour of the day (00-23)
  •    
  • mm – the minute of the hour (00-59)
  •    
  • ss – the second of the minute (00-59)
  •  

 

 
Reply


Messages In This Thread
Set Specific Access and Modification Time Using Linux Touch Command - by aaron - 09-08-2023, 12:38 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)