I have a file of file paths. The depth of the directories is of various lengths and path names. I'd like to match two directories backwards (two /'s) and delete the match, creating a new file with the results.
eg:
/dir1/dir2/dir3/dir4/dir5/dir6/dir7/output_job3344.xml
/dir1/dir2/dir3/dir4/dir5/otherfile.txt
the result would be:
/dir1/dir2/dir3/dir4/dir5/dir6/
/dir1/dir2/dir3/dir4/
I tried something like this:
awk -F'/*./.*$' '{print $0}' deep.list
but that didn't work out.