Вопрос

I have thousands of html file in a directory. I wanna extract files that contain Chennai in the file name and put it into another folder. I am sure it is possible. I am not close enough to copy the files to another folder.

Это было полезно?

Решение

Use globbing:

mv *Chennai* target/

If the file names might start with a dot, use

mv .*Chennai* *Chennai* target/

Другие советы

Try:

find directory_with_htmls -type f -name "*Chennai*.html" -exec cp {} some_other_folder \;

This would copy html files in the directory_with_htmls directory containing Chennai in the name to the directory some_other_folder.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top