Find modified files with special characters
Hello Everybody
i am new to linux so excuse my question. I am trying to find files modified 1 week ago that contain special characters 'pg' and i am stuck (putty) i use find -mtime +7 How do i specify the special characters ['pg']in command Thanks |
Quote:
Try this command #find -mtime +7 "pg" or #find -mtime +7 p* Hope it will helps you ! |
Well pg aren't what we'd normally call 'special', but I'm guessing you mean as part of the filename?
Code:
find . -mtime +7 -name '*pg*' Special chars are normally non-printable (aka ctrl chars) or meta chars for regular expressions; generally punctuation marks. HTH |
If you mean contain text "pg", I think you'll have to use grep in addition to find. Something like
Code:
while read fname; do grep -I pg "$fname"; done < <(find . -mtime +7) |
All times are GMT -5. The time now is 01:50 PM. |