Domanda

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.

È stato utile?

Soluzione

Use globbing:

mv *Chennai* target/

If the file names might start with a dot, use

mv .*Chennai* *Chennai* target/

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top