Remove directory with exceptions


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Remove directory with exceptions
# 1  
Old 11-30-2009
Data Remove directory with exceptions

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,
ZivSmilie
# 2  
Old 11-30-2009
Double posting is strictly against the rules. Continue here:

https://www.unix.com/shell-programmin...xceptions.html
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Directory can't remove!

Hello my friends, I have a directory called log_old when I try to delete it, it tells me no such file or directory. Then I tried to run this command: ls -lb It tells me the directory name, it is: log_old1\177 !! I tried to remove it using inode, using this... (4 Replies)
Discussion started by: Mohannad
4 Replies

2. Shell Programming and Scripting

RegEx with exceptions

I am totaly new to RegEx, but I need to extract emails with RegEx from text file Some difficulties: 1. “@”symbol has been substituted for “ at ”,"AT" or "(at)" 2. I do not need any email with domain "myoldcompany" I found that with these I can found any emails: "^+@+\.+$" How to do... (1 Reply)
Discussion started by: AIX_30
1 Replies

3. Shell Programming and Scripting

Wildcards and exceptions

Hello: I have a very basic question. I'd like to select all files except for one file. For example, say I want to move all of the files in my current directory to a subdirectory called archive, I would use mv ./* archive/ But what if I want to move all files except for README.txt? Is there an... (19 Replies)
Discussion started by: Danny.Boy
19 Replies

4. Shell Programming and Scripting

Remove Directory

By Mistake i created a directory named "-lrt" in one of my working directories and now i am not able to delete it , please suggest hw to delete this directory now ? Thanks in advance. (1 Reply)
Discussion started by: neeraj617
1 Replies

5. Shell Programming and Scripting

Remove directory with exceptions

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 (3 Replies)
Discussion started by: zivsegal
3 Replies

6. Shell Programming and Scripting

Remove contents of directory, but not directory

What's the best way to delete everything in a directory, but not the directory itself, without using shell wildcards? (9 Replies)
Discussion started by: pdc
9 Replies

7. Solaris

Can't remove a directory

Hello, somehow a directory called -r was created on one of my servers and I can't remove is using either rm or rmdir. Is there a way to remove this directory? Thank you. -David (2 Replies)
Discussion started by: dkranes
2 Replies

8. Shell Programming and Scripting

exceptions in import

Hello, I want to import an Oracle database file on my fresh DB, bought before successfully with exp command. But is it possible to import some tables from the dmp file, because they are too large and it's so long !? I didn't find any option in imp command to make exception on certain tables...... (1 Reply)
Discussion started by: madmat
1 Replies

9. AIX

remove hardlink directory

I have to move a lpar from one 671 to another (aix 5.2 ML 07) when I run mksysb, It alway hangs with "archieving file list" I've tried to exlude every directory, but still not working the only thing that can be a problem, is a hardlink directory normally it should not be possible to... (4 Replies)
Discussion started by: funksen
4 Replies

10. UNIX for Dummies Questions & Answers

smitty, remove user, remove directory as well..

hi, i am on aix. i used smitty to remove a user.. but then found that its directory still exists.... so i have to remove the directory manually... am i doing it the right way? (2 Replies)
Discussion started by: yls177
2 Replies
Login or Register to Ask a Question