V
V
Vitaly Musin2013-12-27 15:30:52
PHP
Vitaly Musin, 2013-12-27 15:30:52

How to find all php files with encoding other than UTF-8?

I found this command on the internet:

find ./ -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail

It does what I need, but it looks at all files, how can I make it look only php?
PS I myself am not strong in bash queries, what can I read about queries in an accessible language?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Nikitenko, 2013-12-27
@vmpartner

find ./ -type f -iname "*.php" | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail

G
gaelpa, 2013-12-27
@gaelpa

You can read man find .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question