Re: mv and exlude list

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

 



Guillaume CHARDIN 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

Try:

	find /data/product -name "*.dat" -prune -exec mv \{\} \
	/data/archives/2005 \;

You might try using "cp" instead of "mv", just to test it.  If it works,
then "find /data/product -name "*.dat" -exec rm -rf \{\} \;" to delete
the files.  Note that the target directory MUST exist before you run
the first command.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer                      ricks@xxxxxxxx -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-       Charter Member of the International Sarcasm Society          -
-                "Yeah, like we need YOUR support!"                  -
----------------------------------------------------------------------

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux