开发者

error /usr/local/bin/perl: Argument list too long

开发者 https://www.devze.com 2023-01-06 00:54 出处:网络
ive executed this command to delete malwarm from all my websites files and keep backup from each filesbut after 1 mint from executing got error

ive executed this command to delete malwarm from all my websites files and keep backup from each files but after 1 mint from executing got error /usr/local/bin/pe开发者_如何学Pythonrl: Argument list too long

Can anyone suggest a way to avoid this error , PS ive a huge a mount of files :)

 perl -e "s/<script.*PaBUTyjaZYg.*script>//g;" -pi.save $(find /home/ -type f -name '*php*')


Use the xargs command which reads file names from STDIN and runs the command multiple times passing as many filenames as it can to each invocation of the target command

find /home/ -type f -name '*php*' -print0 | xargs -0 perl -e "s/<script.*PaBUTyjaZYg.*script>//g;"

The print0 argument to find works with the -0 argument to xargs to ensure that file names are terminated with a null character. This prevents filenames with embedded spaces from causing an error.

0

精彩评论

暂无评论...
验证码 换一张
取 消