Manipulation with the string using sed

hello All,
When I run

 find 

command on certain directory I may get one of the following output depending on configuration

A. ./rel/prod/libpam.a
B. ./rel/fld/libpam.a
C. ./deb/detail/libpam.a
D. ./deb/err/libpam.a
         I want to get output as below
A. rel/prod
B. rel/fld
C. deb/detail
D. deb/err

respectively.
I can get rid of leading "./" characters by using cut command cut -c 3-5 but how to get rid of trailing "/libpam.a" ??

Regards,
Anand Shah

man find . Have you tried the option -type d ?

To get rid of unwanted chars in your output lines, sed is your friend, e.g. sed 's:^..::' to remove the two initial chars.

With awk

awk -F"[ ./]" '{print $1". "$5"/"$(NF-2)}' file
A. rel/prod
B. rel/fld
C. deb/detail
D. deb/err