Move files from several subdirectories one level back
Hi,
I hope you can help me with this issue. I'm trying to move a lot of files, currently located in numbered subdirectories, one level back. The subdirectories are named as ../invoices/invoice00001/ ../invoices/invoice00002/ etc. They all contain one file (invoicexxxxx.odt). And all these files should all go to the folder directly above those directories, '/invoices/. Is it possible to do that via a shell script? To do it manually would take me probably all day! :) Thanks for any help, Marinus. |
Easy to do but not sure if you mean you want to move the files in invoice001 and invoice002 to invoices or if you mean invoices/invoice001 and invoices/invoice002 to the directory above invoices. Process is the same but off course details are different.
So within the directory invoices: Code:
for DIR in `ls -d invoice*` If you want to go to the parent directory above invoices just use .. instead of . (.. = parent directory of current directory). |
Hi J.,
that's exactly what I was looking for! Thanks very much. Marinus. |
All times are GMT -5. The time now is 05:59 PM. |