![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | 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. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Hi,
I want to remove a directory recursively except the inside directories calles .SYNC (designsync dirs) I am looking for something like: \rm -rf < find . * | grep -v .SYNC The find works ok but I do not know how to redirect it. Please help. Regards, Ziv |
|
|||
|
What's the meaning to put a * in your find script? your request can be combined into one command: Code:
find . ! -name "*.SYNC" -type f -exec echo rm -rf {} \;
if you review the output, and it is fine, then run below command to delete files. Code:
find . ! -name "*.SYNC" -type f -exec rm -rf {} \;
|
|
|||
|
Thanks
The second solution solve it.
Regards, Ziv ![]() ![]() ![]() ![]() ![]() |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove directory with exceptions | zivsegal | UNIX for Advanced & Expert Users | 1 | 11-30-2009 12:44 PM |
| Remove contents of directory, but not directory | pdc | Shell Programming and Scripting | 9 | 04-09-2009 03:02 PM |
| Can't remove a directory | dkranes | SUN Solaris | 2 | 07-28-2008 11:38 AM |
| smitty, remove user, remove directory as well.. | yls177 | UNIX for Dummies Questions & Answers | 2 | 11-11-2002 02:43 AM |
| remove a nonempty directory | babayeve | UNIX for Dummies Questions & Answers | 2 | 08-26-2002 12:34 PM |