I have a directory Dir in which I have about 30 sub-directories. From these 30 sub-dirs there are about 20 with name dir_date and the other 10 with some random names. I want to move all the directories that contain dir in their names to another directory which could be created under Dir using the command line. I am using CentOS 5.7
In a terminal, you can simply do
mv *dir* /example/location
where dir is a pattern that matches anything containing "dir". Fix the pattern to match your needs.
This will move all files containing "dir" in the directory you are in (in terminal, type pwd to check your current directory).