find and remove a line in multiple files
问题 I have many files, and I have to find a single line in these files and delete, and should be in terminal in linux. Anyone know how to do? Example FileSystem myFiles + file1 + file2 ... + file6500 The file aaa0 aaa1 .... fff9 回答1: This would delete that line in each file. for f in myFiles/*; do sed -i 'd/pattern that matches line that you want to delete/' $f done Alternatively you could use awk as well. tmp=$(mktemp) for f in myFiles/*; do awk '!/pattern that matches the line that you want to