- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Extract a directory path and contents from a CPIO ...
Operating System - HP-UX
1819931
Members
3259
Online
109607
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО12-29-2009 12:31 PM
тАО12-29-2009 12:31 PM
I can extract a single file:
cpio -ivdm opt/soft/config.txt
But how do I extract the entrore contents of /opt/soft/* and subdirs, etc... without sing a list file?
cpio -ivdm opt/soft/config.txt
But how do I extract the entrore contents of /opt/soft/* and subdirs, etc... without sing a list file?
Hakuna Matata.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2009 01:27 PM
тАО12-29-2009 01:27 PM
Solution
cpio accepts wildcards, but you must protect them with quotes or backslashes so that the shell won't attempt to expand the wildcards before executing the command line:
cpio -ivdm "opt/soft/*" or
cpio -ivdm 'opt/soft/*' or
cpio -ivdm opt/soft/\*
This is a standard feature of unix-style shells. Whenever you need the wildcards to apply to something that is either not local or not yet present in the filesystem when the command starts, you'll usually need to quote or backslash your wildcards.
MK
cpio -ivdm "opt/soft/*"
cpio -ivdm 'opt/soft/*'
cpio -ivdm opt/soft/\*
This is a standard feature of unix-style shells. Whenever you need the wildcards to apply to something that is either not local or not yet present in the filesystem when the command starts, you'll usually need to quote or backslash your wildcards.
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2009 01:37 PM
тАО12-29-2009 01:37 PM
Re: Extract a directory path and contents from a CPIO Archive
Hi:
The 'cpio' utility understands pattern matching notation used by the shell. To avoid having the shell interpret and expand that pattern, escape with a backslash character every meta-character.
Thus, '/opt/soft/*' would need to be written as '/opt/soft/\*'.
Regards!
...JRF...
The 'cpio' utility understands pattern matching notation used by the shell. To avoid having the shell interpret and expand that pattern, escape with a backslash character every meta-character.
Thus, '/opt/soft/*' would need to be written as '/opt/soft/\*'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2009 03:02 PM
тАО12-29-2009 03:02 PM
Re: Extract a directory path and contents from a CPIO Archive
>how do I extract the entire contents of /opt/soft/* and subdirs, etc... without using a list file?
The same as for a single file. Or you use pax(1) instead.
pax -r -v -f archive opt/soft
>MK: cpio accepts wildcard
>JRF: The 'cpio' utility understands pattern matching notation
Not sure why you would need them? Just provide the upper directory.
The same as for a single file. Or you use pax(1) instead.
pax -r -v -f archive opt/soft
>MK: cpio accepts wildcard
>JRF: The 'cpio' utility understands pattern matching notation
Not sure why you would need them? Just provide the upper directory.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP