![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using Rename to move files | snufse | UNIX for Dummies Questions & Answers | 1 | 04-09-2008 09:57 AM |
| how to move files | monicasgupta | Shell Programming and Scripting | 1 | 03-14-2008 12:53 PM |
| move files | uniksbro | UNIX for Advanced & Expert Users | 4 | 07-31-2007 08:42 AM |
| move files | ust | Shell Programming and Scripting | 5 | 07-03-2005 11:41 PM |
| move files | mta | UNIX for Dummies Questions & Answers | 2 | 01-16-2004 09:22 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
How to move all files except one?
Hello,
I have to move all files, except one, from one directory to another. I tried it with mv and find: mv -f $(find $SOURCE -maxdepth 1 ! -name "FileNotToMove") $TARGET It nearly worked out, but unfortunately not only the content of the $SOURCE directory got moved, but also the directory itself. I am just a beginner and don't have any ideas left how to do it in a proper way. Last edited by Kim Walisch; 01-21-2008 at 06:45 AM. |
| Forum Sponsor | ||
|
|
|
|||
|
Code:
mv -f $(find $SOURCE -maxdepth 1 ! -name "FileNotToMove" -type f) $TARGET |