Re: [SLE] compare dir
- From: Simon Roberts <thorpflyer@xxxxxxxxx>
- Date: Tue, 7 Mar 2006 09:52:36 -0800 (PST)
On Tuesday 07 March 2006 10:18, James Hatridge wrote:
Hi all...have the
I need to compare two dir and delete files in the second dir that
same name as in the first. How could I do this?
Try:
cd <<directory containing files you might delete>>
for i in *
do
if [ -f <<path to other directory>>/${i} ]
then
rm $i
fi
done
Try this first without the actual "rm" statement, replace it with
something like "echo ${i} should be deleted" That way you can tell what
it would do and whether you like the results.
Cheers,
Simon
"You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions." ? Naguib Mahfouz
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-faq@xxxxxxxx
- References:
- Re: [SLE] compare dir
- From: Carl Hartung
- Re: [SLE] compare dir
- Prev by Date: Re: [SLE] compare dir
- Next by Date: [SLE] Firefox going down or what?
- Previous by thread: Re: [SLE] compare dir
- Next by thread: Re: [SLE] compare dir
- Index(es):
Relevant Pages
|