![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| recursive wc on a directory? | bimba17 | UNIX for Dummies Questions & Answers | 13 | 06-21-2009 12:51 PM |
| Recursive search for group or other writeable 'dot' files | maficdan | Security | 5 | 02-14-2008 09:43 PM |
| Restrict my search to current directory. | sachin.gangadha | UNIX for Dummies Questions & Answers | 7 | 12-01-2007 12:37 PM |
| Recursive Search and replace only when found string | umen | Shell Programming and Scripting | 1 | 05-07-2006 02:20 PM |
| Question about Restricting Search path of FIND to current directory | super_duper_guy | UNIX for Dummies Questions & Answers | 2 | 10-17-2005 10:10 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi,
Am trying for a script which should delete more than 15 days older files in my current directory.Am using the below piece of code: "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/ls -altr {} \;" "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/rm -f {} \;" But it is exploring sub directories too which i dont want have permission and dont want it to happen too.I just want to find and delete the files in the current directory alone. Could any one of you please help me.... waiting for help!! Thanks in advance... |
|
||||
|
Quote:
Code:
find . -path '/directory/not/to/include' -prune -o -name "*" | xargs grep "pattern" if you have many directories to exclude you can do something like this.. Code:
find . \( -path "/dir/to/exclude" -prune -o -path "/dir/to/exclude/" \) -name "*" | xargs grep "pattern" Thanks Namish Last edited by namishtiwari; 07-28-2008 at 04:18 AM.. Reason: added for multiple dir |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|