You are not logged in.
Pages: 1
not sure this is the forum to post this in, but here goes:
say i wanted to chown a bunch of files with a criteria. how would i do that?
i was thinking to chown today's modified files, for example, i would do something like
ls -la | grep "2009-04-28" > chown me
or something to that effect. obviously that's not the right line though. can someone get me pointed in the right direction? or a better way?
thanks for all of your help
Offline
man find
It can both check for modification time with -mtime and run a command on the found file with -exec
Offline
sweet, this is perfect. thanks guys
Offline
comon Procyon, that's no fun!
ls -la | grep "2009-04-28" | awk '{print $8}' | while read file; do chown me $file; done
just kidding, find is definitely the way to go
pftt... loose the grep... it will save you milliseconds!
ls -la | awk '/2009-04-28/ {print $8}' | while read file; do chown me $file; done
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
Pages: 1