top of page
Writer's pictureJatin Madaan

Create a unix file with old timestamp


Sometimes we need to change a file without changing timestamp of a file in unix .


This can simply be done by using touch command .


$ touch -r -- command will create a file with same timestamp as old one.



In above commands it is clear that there was one file date1.txt which was created on 3rd April and then command :


$ touch -r [source_file_name_whose_timestamp_is_copied][target_file_with_same_timestamp_as_source_file]


This command creates another file date.txt which is of size zero and old timestamp .



59 views0 comments

Comments


bottom of page