1

I have been trying to change the date created and date modified for multiple files inside multiple sub folders. There are about 29000 files spread access 500 folders, each with at least 1 level of sub-folders within.

I have been experimenting with the touch command via terminal, but can't get it to work for more than 1 sub solder (about 15 files) at a time.

I am working on the files locally on an external hard drive.

What syntax do I need to use in order to bulk process all of these files in one go, changing both the date created and date modified to a specific timestamp (20200601 12:01:01 for example).

cheers

2
  • Do you need wildcards in any form, or do you want to touch all files? – nohillside Jul 10 '20 at 5:59
  • all files, i think the comments below have the results that I'm after – Pete Booth Jul 10 '20 at 10:51
1

The typical way to do this on Unix-based system is to combine find and touch

find path/to/top/directory -type f -exec touch -t 0601120101 '{}' +
  • path/to/top/directory: top directory to start search in, its content and all subdirectories will be searched. You can add several if required
  • type -f: only find files. If you also want to touch directories, just remove it
  • exec ... +: run the command on the matching items (in our case all files), replacing {} with the names of the items.

PS: To just see the files found use find path/to/top/directory.

1
  • thanks this works exactly how i wanted it to. – Pete Booth Jul 10 '20 at 10:50
0

The app A Better Finder Attributes is the app you should try. It has a free trial so you can see if it works for you.

Disclaimer: I have no financial or other ties with the developer of this application. I am a satisfied user.

1
  • this is a great app, thanks – Pete Booth Jul 10 '20 at 6:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .