Итак, если файл1 содержит:
Код: Выделить всё
/dirA/subdir1/somefile
/dirB/subdir2/somefile
/dirB/subdir2/somefile
/dirC/subdir2/somefile
/dirD/subdir1/somefile
Код: Выделить всё
/dirB/subdir2/
Код: Выделить всё
/dirA/subdir1/somefile
/dirC/subdir2/somefile
/dirD/subdir1/somefile
Код: Выделить всё
sed '/pattern to match/d' file1
Код: Выделить всё
sed 's?#REPLACE-WITH-PATH?'`pwd`'?'
Код: Выделить всё
sed '/'`pwd`'/d' file1
sed '?'`pwd`'?d' file1
sed '#'`pwd`'#d' file1
Подробнее здесь: https://stackoverflow.com/questions/793 ... -directory