Frage

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.

War es hilfreich?

Lösung

Use globbing:

mv *Chennai* target/

If the file names might start with a dot, use

mv .*Chennai* *Chennai* target/

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top