chmod command for recently modified files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers chmod command for recently modified files
# 1  
Old 08-21-2006
Question chmod command for recently modified files

hello! is there a way for me to use the chmod command to change permissions for several files all at once -based on the fact that these files were all most recently modified TODAY ?

I can't use a wildcard on their filenames because the filenames are varied. But I was hoping I could somehow do this on the commonality that they were all modified today. Is there anyway to say this to Unix? Smilie

~polka
# 2  
Old 08-22-2006
This finds all the files in a directory that are less than 24 hours old, and runs a chmod 777 filename on each one - the {} thing is the filename
Code:
find . -type f -mtime -1 -exec chmod 777 {} \;

# 3  
Old 08-30-2006
thank you jim.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copy files from one drive to another, keeping most recently modified files

Hi all, I am a bit of a beginner with shell scripting.. What I want to do is merge two drives, for example moving all data from X to Y. If a file in X doesn't exist in Y, it will be moved there. If a file in X also exists in Y, the most recently modified file will be moved to (or kept) in... (5 Replies)
Discussion started by: apocolapse
5 Replies

2. UNIX for Dummies Questions & Answers

Find command to get the modified files past 2 hours

Hello, How to get the modified/created files past 2 hours in Solaris with find command? Thank you. (7 Replies)
Discussion started by: balareddy
7 Replies

3. UNIX for Dummies Questions & Answers

Finding the modified timestamp of files from the piped output of du command

Version Info +++++++++++++++ RHEL 5.4 Since ls command lists file sizes in Bytes which can be long I use du command like below. I have run the du command for the below files as shown below. But I want pipe this output to ls command just to see the modified timestamp for these files. ... (7 Replies)
Discussion started by: kraljic
7 Replies

4. Shell Programming and Scripting

Trying to modified files using sed command

hi all, i will like to modified some files with the extension .gjf . All this files have in first line this #P PM3 Opt and i want to change that to this : %nproc=2 %chk=filename.chk #p B3LYP /6-31G** opt in order to do that i have try to do a script with the sed command but i... (4 Replies)
Discussion started by: juanchy
4 Replies

5. UNIX for Advanced & Expert Users

command for recently modified files - "find" command not working

I have three files a.txt , b.txt , c.txt in a directory called my_dir1 .These files were created before two or three months . I have a tar file called my_tar1.tar which contains three files a.txt , b.txt , d.txt . Somebody untarred the my_tar1.tar into my_dir1 directory. So existing two files were... (1 Reply)
Discussion started by: joe.mani
1 Replies

6. Shell Programming and Scripting

command to know files modified morethan 30 min

Hi, i use ksh and want to know the command for gettting the files which were not modified in last 30 min. find . -name <filename > -mtime 0.0209 is not giving the results. Thanks , Mohan (3 Replies)
Discussion started by: mohanpadamata
3 Replies

7. UNIX for Dummies Questions & Answers

Find most recently modified directories

How do I do it? Simple answers preferred... using BASH.. the less code the better. I want to find out where Indesign is caching PDF tmp data ... I figure this is a good way to do it.. either way i wanna know how to do it. (2 Replies)
Discussion started by: glev2005
2 Replies

8. Shell Programming and Scripting

find recently modified/ updated file

hi gurus, i would like to know how can i find logs files which were recently modified or updated? :confused: using this command? find . -name "*.log" -mtime ?? so what should i put for mtime? thanks. wee (9 Replies)
Discussion started by: lweegp
9 Replies

9. UNIX for Dummies Questions & Answers

Help - Find command with list of files modified descending Order

Hi, I would like to know the command to get the files order in descending order with "FIND" command. Appreciate your help Thanks (4 Replies)
Discussion started by: TonySolarisAdmi
4 Replies

10. Shell Programming and Scripting

ftp most recently modified file

Hi what is the most optimum way to ftp the most recently modified file starting with a particular string. i tried this ftp -n 2>logfile 1>&2 <<EOF open xxxxxx user xxxx xxxx prompt ls -ltr f* res !var=`tail -1 |awk { print $9 }'` bye EOF that gives... (6 Replies)
Discussion started by: ahmedwaseem2000
6 Replies
Login or Register to Ask a Question