- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- File copy
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 11:11 AM
06-03-2002 11:11 AM
File copy
These files all are start with tw* But my problem is I don't want few files those are having .txt extension but they also are starts with tw*
cp tw* to destination dir would copy all the files starts with tw , but I don't want one with .txt
How do I do this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 11:16 AM
06-03-2002 11:16 AM
Re: File copy
Sandip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 11:21 AM
06-03-2002 11:21 AM
Re: File copy
find / \( -name 'tw*' -a ! -name '*.txt' \) -exec rm {} \;
would do it for you.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 11:32 AM
06-03-2002 11:32 AM
Re: File copy
# cd dir
# find . \( -name 'tw*' ! -name '*.txt' \) -depth | cpio -pdlmuva dest_dir
The 'expression' checks the condition and copy the files matches to the dest_dir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 11:34 AM
06-03-2002 11:34 AM
Re: File copy
do a
ls tw* | grep -v txt > list
cp 'cat list' < destiantion >
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 11:36 AM
06-03-2002 11:36 AM
Re: File copy
# cd /tmp
# find . \( -name 'tw*' -a ! -name '*.txt' \) -exec cp {} /test \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 11:48 AM
06-03-2002 11:48 AM
Re: File copy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 11:56 AM
06-03-2002 11:56 AM
Re: File copy
cp `ls -d tw* | grep -v '\.txt$'` "destination_directory"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 12:01 PM
06-03-2002 12:01 PM
Re: File copy
find /tmp -type f -name "tw*" | grep -v "\.txt$" | xargs -i cp {} /var/tmp
Will copy files, that start with "tw" and aren't ".txt" files, from /tmp to /var/tmp.
Pete,
I'm not sure he want's to remove the original (the -exec rm {} clause).
live free or die
harry