简体   繁体   中英

How to recursively remove the caret (^) character recursively in all files in a directory?

I wish to remove all caret characters from all files present in the current directory. Please help.

You must tell sed to edit the file in place by specifying the the -i option, otherwise sed will write to its stdout. You're not passing any file names to sed . Use {} syntax of find to pass matched file names.

find . -type f -exec sed -i 's/\^//g' {} +

Please note that to replace matched patterns with nothing, you must leave the replace part of the substitution empty.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM