$ echo "file_contents" > filename.txt
$ find . -type f -print0 | xargs -0 sed 's/file//g'
_contents
How do you get sed to treat the filename as a string instead of an input file? What command do I need to get "name.txt
" as the output instead?
Drop the xargs
and -0
's.
find . -type f | sed 's/file//g'
This takes the output of find
and sends it as input to sed
.