change the date file created
I have big sure and I am trying to change the date a file was created in terminal but it does not recognise the command
iMac 21.5″ 4K, macOS 11.5
You can make a difference in the Apple Support Community!
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
I have big sure and I am trying to change the date a file was created in terminal but it does not recognise the command
iMac 21.5″ 4K, macOS 11.5
The UNIX shell is unforgiving when you don't follow command syntax rules. Replace foo.jpg below with your image path/name. I have entered the Terminal syntax here using the <> tool on this editor's toolbar.
touch -t 202106061111.00 foo.jpg
In addition to entering x-man-page://touch in Safari's address field, you can also open the touch man page variously as:
man touch
or
man -t touch | open -f -a Preview
The UNIX shell is unforgiving when you don't follow command syntax rules. Replace foo.jpg below with your image path/name. I have entered the Terminal syntax here using the <> tool on this editor's toolbar.
touch -t 202106061111.00 foo.jpg
In addition to entering x-man-page://touch in Safari's address field, you can also open the touch man page variously as:
man touch
or
man -t touch | open -f -a Preview
ok well I have managed to change the modified date is there a way to change the creation date?
What confused me was when you spoke about typing things in the Safari address bar.
I do not understand this bit In addition to entering x-man-page://touch in Safari's address field, you can also open the touch man page variously as:
man touch
or
man -t touch | open -f -a Preview
I did the first part into the terminal and replaced foo.jpg
I should have remembered that the touch command cannot change the creation date of a file. If you have Xcode or the command-line tools for Xcode installed, you will have the setfile command, which does allow one to change the file creation date.
setfile -d "09/11/2021 14:05:00" xyz.txt
When verified in a Get Info window for this file, the creation date/time is set to 2:05 pm for that date.
Hi I have installed Xcode and used the above and it is changing the time and the date but not the month and it is not changing it to what I want. this is what I put:
setfile -d "31/08/2021 14:05" xyz.txt
see attached
Copy the command and response from Terminal and paste it here in a reply.
Thank you for your help. I am very new to this and don't understand what you have written please can you put it in basic steps.
It is as simple as it can be explained. You enter those man commands in the Terminal just as I showed for the touch command.
setfile -h
You will note that the application expects the date in the MM/DD/YYYY format, not what you are accustomed to in your locale.
change the date file created