Computing.Net > Forums > Unix > Script to chmod today's files...

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Script to chmod today's files...

Reply to Message Icon

Name: higgies
Date: December 4, 2002 at 06:53:36 Pacific
OS: Solaris/IRIX
CPU/Ram: NA
Comment:

Hi all!

I am trying to come up with a script which will find all files created within a day and then chmod them to set the execute bit. Anyone got any ideas? I can come up with the files using
find . -time1
but I then need to use that output as input for a:
chmod u+x

Any help would be great! Thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: December 4, 2002 at 09:45:47 Pacific
Reply:

find . -mtime -1 -exec chmod u+x {} \;

or

for file in `find . -mtime -1` ; do
chmod u+x $file
done


0

Response Number 2
Name: higgies
Date: December 4, 2002 at 16:44:31 Pacific
Reply:

Thanks! Worked like a charm!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Script to chmod today's files...

Tansfer files script to be modified www.computing.net/answers/unix/tansfer-files-script-to-be-modified/6101.html

Remote script to chmod www.computing.net/answers/unix/remote-script-to-chmod/7397.html

Writing batch script to delete files www.computing.net/answers/unix/writing-batch-script-to-delete-files/120.html