Moving files to a directory

前端 未结 6 2093
长发绾君心
长发绾君心 2020-12-16 20:13

I want to move all files matching a certain pattern in the current directory to another directory.

For example, how would I move all the files starting with

6条回答
  •  盖世英雄少女心
    2020-12-16 21:19

    find . | grep "your_pattern" | xargs mv destination_directory
    

    Does the following:

    • Finds all files in the current directory
    • Filters them according to your pattern
    • Moves all resulting files to the destination directory

提交回复
热议问题