Score:2

exclude files that have specific characters in name

pn flag

here is my command to find files in a specific location and with specific extensions only, it works fine. But I want to exclude files that have '_bkp' or '_backup' as a substring in their file names -

find /httpdocs/ -type f \( -iname \*.php -o -iname \*.html -o -iname \*.js -o -iname \*.css ! -iname  "*_bkp*" ! -iname  "*_backup" \) -newermt 2022-12-27 -print0 | xargs -0 zip -r /UpdatedFiles.zip

but it is not excluding files that have character '_bkp' or '_backup' in their file names.

please help me to solve this. Thanks

Raffa avatar
jp flag
Related: https://askubuntu.com/a/1447690/968501
Score:1
pn flag

I was able to solve the issue, did some modifications in command and it worked for me -

Here is the workable command -

find /httpdocs/ -type f \( -iname \*.php -o -iname \*.html -o -iname \*.js -o -iname \*.css \) ! \( -name "*bkp*" -o -name "*backup*" \) -newermt 2022-12-27 -print0 | xargs -0 zip -r /UpdatedFiles.zip
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.