Under a Linux shell, how can I change the creation time of all a folder's files to the current time?

  • 2
    The files don't have a 'create time' but they do have a 'modification time'. To change the modification time of a file you use the touch command, e.g. $ touch file1 file2 file3
    – boehj
    Jun 19, 2011 at 0:46
  • 1
    Were these answers helpful to you @tomy?
    – boehj
    Jun 27, 2011 at 6:45
  • @boehj Thanks for pointing out that files don't have a creation time
    – Meredith
    Aug 28, 2014 at 2:21

3 Answers 3


The OP asked for the creation time, but Ian Yang and boehj answers are based on command touch setting the modification, access and change times to current time.

As boehj said (in his comment) there is no creation time of a file... This is true for most of the filesystems, but on some modern filesystems (as ext4) the creation (or birth) time of a file is stored within the inode.

Therefore we can give a more correct answer scrupulously respecting the question title:

cp -a  your-folder tmp-folder
rm -rf your-folder
mv tmp-folder your-folder

This will change the creation time (birth time) to the current time. This also updates the change time but keep unchanged the modification and access times.

For information, the change time is sometimes abbreviated as ctime and can be confused with the creation time (crtime or btime). In fact, the change time of a file is the modification time of its corresponding inode. Therefore commands modifying inode content as chmod or chattr also set the change time to current time.

  • As far as I know, most if not all Linux filesystems do not save a creation time.
    – terdon
    Aug 26, 2013 at 17:03
  • Thank you @terdon for your comment, I have updated my answer (change comment is "creation time available on some modern filesystems only as stated by terdon"). Cheers ;-)
    – oHo
    Aug 26, 2013 at 17:22

Navigate to the folder in question, let's say, ~/Documents/myfiles.

$ cd ~/Documents/myfiles

Then do:

$ touch *

This will change the modification time to whenever you executed that command.

Obviously you can make this more specific depending on your use case, e.g.

$ touch *.doc

will only alter the modification time for files with the string '.doc' in their name.


In Linux, if you want to do some thing recursively in directory, or you want to apply some actions on files meeting some criterions,you should try find and xargs

Touch all files in ~/Documents/myfiles (including files in sub directory)

find ~/Documents/myfiles -type f -print0 | xargs -0 touch
  • 2
    Without xargs: find dir -type f -exec touch {} + (sets to now the modification/access/change times of all files recursively)
    – oHo
    Aug 26, 2013 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.