mv and exlude list
Bruno Wolff III
bruno at wolff.to
Thu May 7 18:25:43 UTC 2009
On Thu, May 07, 2009 at 17:38:47 +0200,
Guillaume CHARDIN <guillaume.chardin at 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.
More information about the fedora-list
mailing list