$ echo "file_contents" > filename.txt
$ find . -type f -print0 | xargs -0 sed 's/file//g'
_contents
如何让sed将文件名视为字符串而不是输入文件?我需要什么命令才能获得";CCD_ 1";作为输出?
删除xargs
和-0
的s。
find . -type f | sed 's/file//g'
这取find
的输出并将其作为输入发送到sed
。