commands.sh

setfile

macos

Set file attributes on files in an HFS+ directory.

More info →

Examples (3)

Set creation date for specific files

setfile -d "MM/DD/YYYY HH:MM:SS" path/to/file1 path/to/file2 ...

Set modification date for specific files

setfile -m "MM/DD/YYYY HH:MM:SS" path/to/file1 path/to/file2 ...

Set modification date for symlink file (not to linked file itself)

setfile -P -m "MM/DD/YYYY HH:MM:SS" path/to/file1 path/to/file2 ...
made by @shridhargupta | data from tldr-pages