Click here to Skip to main content
15,891,513 members
Home / Discussions / System Admin
   

System Admin

 
QuestionRe: Delete common files between directories A and B from directory B - UNIX Pin
Richard MacCutchan27-Nov-09 5:46
mveRichard MacCutchan27-Nov-09 5:46 
AnswerRe: Delete common files between directories A and B from directory B - UNIX Pin
nt_virus27-Nov-09 6:13
nt_virus27-Nov-09 6:13 
GeneralRe: Delete common files between directories A and B from directory B - UNIX Pin
Richard MacCutchan27-Nov-09 6:33
mveRichard MacCutchan27-Nov-09 6:33 
GeneralRe: Delete common files between directories A and B from directory B - UNIX Pin
nt_virus27-Nov-09 6:40
nt_virus27-Nov-09 6:40 
GeneralRe: Delete common files between directories A and B from directory B - UNIX Pin
Richard MacCutchan27-Nov-09 7:12
mveRichard MacCutchan27-Nov-09 7:12 
GeneralRe: Delete common files between directories A and B from directory B - UNIX Pin
nt_virus27-Nov-09 16:33
nt_virus27-Nov-09 16:33 
GeneralRe: Delete common files between directories A and B from directory B - UNIX Pin
Richard MacCutchan27-Nov-09 21:37
mveRichard MacCutchan27-Nov-09 21:37 
GeneralRe: Delete common files between directories A and B from directory B - UNIX Pin
BTKnight16-Dec-09 15:23
BTKnight16-Dec-09 15:23 
You're on the right track. You don't need the -name parameter, though you'll probably want to make sure that each thing "find" locates is a file, and not something else like a directory or symlink.

"find" can be somewhat annoying in that it will spit out the entire relative pathname for each file it finds. That is,
find ./dirA -type f
will yield
./dirA/file1<br />
./dirA/file2


To get around that, just chdir into dirA before doing the find.

$ cd dirA
$ touch file1 file2 file4 file5
$ cd ../dirB
$ touch file1 file3 file5 file6
$ cd ..
$ ls dirA
file1   file2   file4   file5
$ ls dirB
file1   file3   file5   file6
$ cd dirA
$ find . -type f -exec rm -f ../dirB/{} \;
$ cd ..
$ ls dirA
file1   file2   file4   file5
$ ls dirB
file3   file6
$ 

I would have answered earlier, but I only joined last week. Smile | :) Hope this late reply helps.
QuestionNorton Ghost Pin
devvvy22-Nov-09 8:57
devvvy22-Nov-09 8:57 
AnswerRe: Norton Ghost Pin
Jörgen Andersson22-Nov-09 21:04
professionalJörgen Andersson22-Nov-09 21:04 
Answer[Message Deleted] Pin
ch_Canda3-Dec-09 19:54
ch_Canda3-Dec-09 19:54 
GeneralRe: Norton Ghost Pin
Luc Pattyn4-Dec-09 2:07
sitebuilderLuc Pattyn4-Dec-09 2:07 
QuestionNo Robot Found! Pin
saranathi15-Nov-09 23:33
saranathi15-Nov-09 23:33 
AnswerRe: No Robot Found! Pin
Dave Kreskowiak16-Nov-09 5:09
mveDave Kreskowiak16-Nov-09 5:09 
QuestionMake copy protected CD/DVD Pin
saranathi15-Nov-09 23:31
saranathi15-Nov-09 23:31 
AnswerRe: Make copy protected CD/DVD Pin
natarajarao16-Nov-09 2:09
natarajarao16-Nov-09 2:09 
GeneralRe: Make copy protected CD/DVD Pin
Dave Kreskowiak16-Nov-09 5:08
mveDave Kreskowiak16-Nov-09 5:08 
AnswerRe: Make copy protected CD/DVD Pin
Dave Kreskowiak16-Nov-09 5:08
mveDave Kreskowiak16-Nov-09 5:08 
Questionhow to cancel my membership? Pin
nicole222210-Nov-09 17:23
nicole222210-Nov-09 17:23 
AnswerRe: how to cancel my membership? Pin
Abhishek Sur14-Nov-09 8:20
professionalAbhishek Sur14-Nov-09 8:20 
AnswerRe: how to cancel my membership? Pin
Vasudevan Deepak Kumar16-Dec-09 22:58
Vasudevan Deepak Kumar16-Dec-09 22:58 
QuestionSame user name but difference SID Pin
Mekong River10-Nov-09 16:21
Mekong River10-Nov-09 16:21 
AnswerRe: Same user name but difference SID Pin
Dave Kreskowiak16-Nov-09 5:06
mveDave Kreskowiak16-Nov-09 5:06 
GeneralSetting up domain controller and Active Directory on a Virtual PC. Pin
Brady Kelly8-Nov-09 8:21
Brady Kelly8-Nov-09 8:21 
AnswerRe: Setting up domain controller and Active Directory on a Virtual PC. [modified] Pin
Zach Burnett9-Nov-09 3:51
Zach Burnett9-Nov-09 3:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.