I have a set of files created under different name, but they all have the same directory name at some point. I will like to delete all the files and directories after the common name:
Here is an example:
techs\fins\results\oaks\bigs
tech2\gihs\results\gears\picks
tech3\guar\results\fishy\pics\gemrs
.
.
.
what single find/erase command can I use to erase all the files and directory after the results folder.
Thank you,
Odogbolu98
no single find/erase commnad but more like a string of commnads owuld work.
i mean just off the top of my head for something quick and dirty you could try.....
rm -fr `ls -lR|grep results|grep ^\..*:$`
i am sure you can figure something out.
If you use ksh or bash you can do:
find . -name results | while read d ; do rm -rf $d/* ; done
Thanks everyone, that really works fine. All I wanted was an idea on how to go about it and you guys have done just that.
Thanks,
Odogbolu 98