[find,exec] find files and move to dir

ref, ref2

It is a combined method with two steps for searching files and moving it to a specific directory.

 

example,

$ find -name ‘*.nc’ -exec mv {} ../my_folder \;

  1. find -name ‘*.nc’: find files which are ened by “.nc”
  2. then, move all found files({}) to the folder (“my_folder”)
  3. “\; ” is the necessary

 

So, Simple 🙂

 

Advertisements