extract/select pattern from input

Hey,

examples of the input (text line):

/bla/blMOasdn234.adanif24/blabla.rar
/bla/blMOasdn234.adanif24/blabla23124.bin
/bla/bla/bla/bla/bla/bla.bin

and what I need to do is extract/select only the dir path so the output would be:

/bla/blMOasdn234.adanif24/
/bla/blMOasdn234.adanif24/
/bla/bla/bla/bla/bla/

I was trying to use sed and I could only get the oposite result, like

echo /test/test2/test3/noname.rar | sed 's/\/.*\///'

result noname.rar :confused:

sed 's_\(.*/\).*_\1_'

Regards

awk -F"/" '{for(i=1;i<NF;i++) {printf $i"/"} print ""}' filename

Thank you, works fine!

sed 's/\(.*\)\(\/.*\)/\1/' filename