- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Reading from tar
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
08-01-2008 08:25 AM
08-01-2008 08:25 AM
Reading from tar
I am issuing the following command.
tar -tvf /dev/rmt/0mn /etc/passwd
Instead of just listing passwd file, it lists the whole contents of the archive. How can I just check for a single file say /etc/passwd if it is present on archive or not?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2008 08:52 AM
08-01-2008 08:52 AM
Re: Reading from tar
tar -tvf ..... |grep filename
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2008 09:00 AM
08-01-2008 09:00 AM
Re: Reading from tar
The '-t' options lists the names of ALL files in the tar archive. The '-t' option does NOT accept a filename as an argument to list only one file.
So doing:
# tar -tvf /dev/rmt/0mn /etc/passwd
is exactly the same as doing:
# tar -tvf /dev/rmt/0mn
The '/etc/passwd' argument is ignored.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2008 09:04 AM
08-01-2008 09:04 AM
Re: Reading from tar
pax(1) allows you to provide a pattern but it will probably read the whole tape.
pax -nv -f /dev/rmt/0mn etc/passwd
-n says it selects the first, so that might work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2008 10:13 AM
08-01-2008 10:13 AM
Re: Reading from tar
Make sure you get a listing of what you want to find so you can check your pattern. I.e. if it is a file matching pattern, or something like a regular expression where it isn't automatically anchored with ^ and $.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2008 05:06 AM
08-02-2008 05:06 AM
Re: Reading from tar
Make sure to use the no-rewind device to position the tape with mt.
I am not sure may be filename cannot have a leading path, I can't check now.
tar -xvf /dev/rmt/0m etc/passwd
Make a copy of the current /etc/passwd file before you restore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2008 03:04 PM
08-03-2008 03:04 PM
Re: Reading from tar
Please try using :
# tar -tvf /dev/rmt/0mn|grep "/etc/passwd"
regds,
Deepak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2008 11:06 PM
08-03-2008 11:06 PM
Re: Reading from tar
Check with
tar -tvf /dev/rmt/0mn etc/passwd
etc/passwd not /etc/passwd
Regards
Sanjeev