Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
Reply to this topicStart new topic
> Help With Cp Command, Selectively omit *.dat files copying.
post Nov 10 2005, 12:10 PM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 1
Joined: 10-November 05
Member No.: 5,724

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.

Go to the top of the page
+Quote Post
post Nov 10 2005, 12:22 PM
Post #2

Its GNU/

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828

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.

--Jim Lester

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 21st June 2018 - 11:35 AM