I am trying to use the find and sed commands in Linux to do the following:
- When command is issued in current directory it will edit all ".cbf" files in all directories and sub-directories.
I have been using: this, this and this as research references.
My current command that is not working is:
find . -name "*.cbf" -print0 | xargs -0 sed -i '' -e 's/# change the header/# change the header to something/g'
The error I get is: sed: can't read : No such file or directory
I have tried the command both above the directory with the .cbf files and actually in the directory.
Can someone please help me with what I am doing wrong. I simply wish to edit a line in all .cbf files in subdirectories from where I am sitting.
Thanks in advance