Bash – Find Pattern and Move

bashfind

I'm wondering if anybody knows how to find a pattern and then move it to a different location.

For example,
I have many files named:

odbc.ini_20110630
odbc.ini_20110639
odbc.ini_20110643
etc...

I want to search the pattern of just odbc.ini and move all of them to a different folder.

I'm not too familiar with how to execute two commands at one time (piping).

Best Answer

You can use

find . -name "odbc.ini*" -exec mv {} destination \;

This is assuming that your files are in the directory hierarchy starting at current directory ..

Related Question