Search code examples
linuxmovefile-management

Extract all the files with name containing a keyword


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.


Solution

  • Use globbing:

    mv *Chennai* target/
    

    If the file names might start with a dot, use

    mv .*Chennai* *Chennai* target/