Help - Search - Members - Calendar
Full Version: Help With Cp Command
Linuxhelp > Support > Technical Support
Hi all,
I want to copy a directory named Ec1 to another directory named Ec2, newly created. But Ec1 has a bunch of *.dat files and many many other kinds of files. Whle creating Ec2, I selectively want to omit the *.dat files since they are huge files of the order of 100 MBs and there are hundreds of such files which would consume a lot of time.

How can I use the 'cp -r' command to selectively omit the *.dat files in Ec1 and obtain the Ec2 directory without any *.dat files while copying the directory Ec1.

Any suggestions are appreciated.

I don't know that its possiblew with cp short of using the -i which makes it interactive. You can then select which files to copy, I don't know many files you are talking about or if you're trying to automate it or what.

Otherwise you can always couple it with rm -R *.dat but that waste some resources.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.