remove the ./ from find -print
Posted on Wed 28 September 2022 in tech
If you want to apply a script to each file in a folder recursively you may not want the full relative path. Here is how to remove it.
$ find . -type f -print | sed -e "s|^\./||g"
For example to combine it with xargs and invoke a script on each name it might look like this:
$ find . -type f -print | sed -e "s|^\./||g" | xargs -Ipathsubst sh -c 'echo pathsubst'