Edit Wondering if it would also be possible to add to the script so that it could include files in sub-folders as well. Maybe it could be scripted in a way that would only consider the files in a folder if the Date Modified on the folder is today.
I would like to run this on a parent folder that could potentially have many sub-folders and if those folders don't have a "Date Modified" of today, then it should skip the files in that folder. I was thinking that could speed up the process. Open to thoughts and thanks for the help! I was stuck without this thread. I ended up with a variation that matched any filename with a correctly formatted date, thus:. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 2 years, 8 months ago. Active 1 year, 10 months ago. Viewed 7k times. JadonR JadonR 2 2 silver badges 8 8 bronze badges. Add a comment. It will remove other personal data, however, such as author name for documents, ratings for media files, as well as set a file to read-only or hidden. The attrib command from the Windows PowerShell allows you to view and change file attributes for Windows 10 files. This is a fairly complex method, but also quite limited.
If you want an easier way to change file attributes, use the Attribute Changer app listed below. Third-party apps like Attribute Changer exist to make this far easier, as well as allowing you to change the last modified date and more. Attribute Changer offers the best way to change file attributes on Windows. Let us know if you need further assistance. How satisfied are you with this reply? Thanks for your feedback, it helps us improve the site.
In reply to A. User's post on June 5, Hi Jelo. Tryx3 Article Author. Isn't there a simple touch command like we had in the old days of Windows past? This site in other languages x. As far as the creation time goes, most Linux file systems do not keep track of this value. There is a ctime associated with files, but it tracks when the file metadata was last changed.
If the file never has its permissions changed, it might happen to hold the creation time, but this is a coincidence. Explicitly changing the file modification time counts as a metadata change, so will also have the side effect of updating the ctime. Touch can reference a file's date all by itself, no need to call date or use command substitution. Here's a bit from touch's info page:. For example, to add 8 hours to a file's date filename of file quoted just in case of spaces, etc :.
For example, to find all files in thatdir whose filenames start with an s , and add one day to those file's modified timestamp, use:. It's been a long time since I wrote any kind of Unix program, but I accidentally set the year incorrectly on a bunch of Christmas photos, and I knew if I didn't change the date from to it would be a problem later on.
I modified a script I found here, which originally was used to modify the date by minus one month. Also, while touch -d "2 hours ago" or touch -a -m -t Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more.
Ask Question. Asked 10 years, 3 months ago. Active 8 months ago.
0コメント