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

  Change Access and Modification Time
 

Change Access and Modification Time



 

Change Modification Time


 

The m option, along with the touch command, changes the modification time of a file to the current time:

 
touch -m file_name.txt
  Screenshot of changing modification time using the touch command

 

Change Access and Modification Time


 

To change both access time and modification time with a single command, use the options a and m together:

 
touch -am file_name.txt
 

Now, check the date with both of these commands:

 
ls -l file_name.txt
 
ls -lu file_name.txt
  Screenshot of changing access and modification time using the touch command

 

 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)