Under a Linux shell, how can I change the creation time of all a folder's files to the 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 (
btime). In fact, the change time of a file is the modification time of its corresponding inode. Therefore commands modifying
inode content as
chattr also set the change time to current time.
Navigate to the folder in question, let's say, ~/Documents/myfiles.
$ cd ~/Documents/myfiles
$ 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.