I have the following problem. I've a file containing lots of similar string, actually they are a paths to files. I need to remove the filename from it. Just can't figure out how to do that.
So, for clearance, there is an example input file in1
I need to remove patterns in bold
, so the result should be:
I figured out how to get only filenames, that is easily reached by the following command: sed s/^.*\\/// in1
I've tried to do so to guess inverse sed s/\\/.*$// in1
, but that leads only to the following output:
What am I doing wrong?