Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
cp, exclude files; rm recursive
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matthew Weaver  
View profile  
 More options Sep 25 2000, 3:00 am
Newsgroups: gnu.utils.help
From: Matthew Weaver <msw_1...@yahoo.com>
Date: 2000/09/25
Subject: cp, exclude files; rm recursive
1. Can I get cp to exclude certain files, either by name or by
globbing pattern?

Something like:
cp sourcedir/* destdir/ --exclude sourcedir/*.snm

2. Can rm search for and remove a file or pattern selectively, at more
than one directory level.  I.e. if backup files are scattered at
several levels, and I want to remove them all:
rm *~ --recursive
The -R option only seems to work when removing everything.  

Thanks.

-Matthew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Pizzini  
View profile  
 More options Sep 27 2000, 3:00 am
Newsgroups: gnu.utils.help
From: k...@halcyon.com (Ken Pizzini)
Date: 2000/09/27
Subject: Re: cp, exclude files; rm recursive
On Mon, 25 Sep 2000 18:11:17 -0700,

Matthew Weaver <msw_1...@yahoo.com> wrote:
>1. Can I get cp to exclude certain files, either by name or by
>globbing pattern?

>Something like:
>cp sourcedir/* destdir/ --exclude sourcedir/*.snm

No, cp does not offer that option.  But you can achieve the
same end with other tools; for example:
  find sourcedir/* -type d -prune -o ! -name \*.snm -print0 |
    cpio -pd --null destdir

>2. Can rm search for and remove a file or pattern selectively, at more
>than one directory level.  I.e. if backup files are scattered at
>several levels, and I want to remove them all:
>rm *~ --recursive
>The -R option only seems to work when removing everything.  

Again, not directly.  But consider:
  find . -name \*~ -print0 | xargs -0 rm

                --Ken Pizzini


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Weaver  
View profile  
 More options Sep 27 2000, 3:00 am
Newsgroups: gnu.utils.help
From: Matthew Weaver <msw_1...@yahoo.com>
Date: 2000/09/27
Subject: Re: cp, exclude files; rm recursive
Glad I asked; I wouldn't have figured those out myself.  Thanks!  
-Matthew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »