[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: mv and exlude list



On Thu, May 07, 2009 at 17:38:47 +0200,
  Guillaume CHARDIN <guillaume chardin gmail com> wrote:
> Hi, maybe some scripting genius gonna help me :D
> 
> I need to move some file from one directory to other with some exclusions.
> Ex: move files from "/data/product/" to "/data/archives/2005" while
> the "*.dat" file/dirs stay in the right place.
> 
> $mv /data/product/* !(/data/product/*.dat) /data/archives/2005
> 
> 
> If you have a solution, please tell me :)

Look at building the list of files with 'find'. 'find' has a man page that
will describe options that can be used to do that. The -name option in
particular will be useful for your case.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]