-   Linux - Newbie (
-   -   moving files to different directories (

congos 12-11-2011 12:59 AM

moving files to different directories
im trying to move media and other files which are in a specified directory to another directory and create another one if it does not exits(where the files will go),them also create a directory will the remaining files with different extensions will first problem is that my script is not making a new directory and it is not moving the files to other directories and what code can i use to move files with different extensions to one directory? this is what i have had so far,correct me where im wrong and help modify my script

To=/home/katy/mo #directory where the media files will go
WA=/home/katy/do # directory where the other files will go
if [ ! -d "$To" ]; then
mkdir -p "$To"
cd $From
find path -type f -name"*.mp4" -exec mv {} $To \;

EDDY1 12-11-2011 01:20 AM

mv /home/username/doc /home/katy/mo will create /home/katy/mo/doc which you can rename "doc", if you have media & docs you can create a new folder within doc & add the new folder to command to move for example /home/username/doc/newfolder.

After looking at other posts made by you I believe that the answer I provided may not be the answer that you were looking for.
Opening new thread on same subject is not the way to get the answer, stay persistant & supply the information requested on previous post & that person may have the answer you desire.

All times are GMT -5. The time now is 11:14 AM.