- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- "Tar" Command
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-02-2003 11:55 AM
06-02-2003 11:55 AM
"Tar" Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2003 11:57 AM
06-02-2003 11:57 AM
Re: "Tar" Command
Should list it for you. (Where /dev/rmt/0 is your tape device.)
Hope it helps
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2003 11:59 AM
06-02-2003 11:59 AM
Re: "Tar" Command
Thats 'tar -tvf /dev/rmt/0 |grep a* |more'
(My brain siezed. The 'c' option of tar is for writing, not reading.)
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2003 12:02 PM
06-02-2003 12:02 PM
Re: "Tar" Command
tar -tvf /dev/rmt/0m |grep a* > /tmp/test
HTH,
Piyush
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2003 12:03 PM
06-02-2003 12:03 PM
Re: "Tar" Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2003 12:04 PM
06-02-2003 12:04 PM
Re: "Tar" Command
I suggest you redirect the output to a file if you suspect there are lot of files that start with 'a'
tar -tvf /dev/rmt/0 | grep a* > /tmp/foo.out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2003 12:11 PM
06-02-2003 12:11 PM
Re: "Tar" Command
Try:
tar -tvf /dev/rmt0 |grep a* |pg
or
tar -tvf /dev/rmt0 |grep a* > filename
Regards,
DR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2003 12:51 PM
06-02-2003 12:51 PM
Re: "Tar" Command
1. The shell will automatically expand a* to match any filenames in the current working directory which won't produce a meaningful result.
2. a* matches the letter a anywhere in the filename, not just the first character, and the filename is located at the end of the tar -tvf listing.
You'll need to extract the filename portion fromn the tar output using something like awk, then extract the basename of the file itself (in case there are leading directories stored on the tape) and finally, anchor the search to the begining of the filename as in:
tar tvf /dev/rmt/0m | awk '{print $NF}' | while read MYFILE;do echo $(basename $MYFILE) | grep ^a ; done
Test this command with other letters like ^b or ^s to see that it produces the desired result. Note that tar, unlike fbackup and other commercial tools, has no central index dso the entire tape must be read to get an index. You might want to grab the index in one command and sort the result into a file for easy scanning:
tar tvf /dev/rmt/0m | awk '{print $NF}' | sort > /var/tmp/filenames
(sorts using full pathname)
tar tvf /dev/rmt/0m | awk '{print $NF}' | while read MYFILE;do echo $(basename $MYFILE) | sort > /var/tmp/filenames
(sorts by the filename only)
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 04:21 AM
06-03-2003 04:21 AM
Re: "Tar" Command
you can list the cut the file name filed from tar tvf command and then pass this input for files starting with 'a'. In general file name is 8th filed of tar tvf output. If it is not 8th filed, replace 8 with filed number.
tar tvf
Regards
VJ.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 04:39 AM
06-03-2003 04:39 AM
Re: "Tar" Command
I suggest the following command line (assuming you look for files with 'a'):
tar tf
To get just the filenames, you do not need the verbose option, and in using separator '/', you have no problems with file/dirnames, containing spaces.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 04:47 AM
06-03-2003 04:47 AM
Re: "Tar" Command
Sometimes using a more clever tool can be useful ... Use pax and be careful to quotes !
pax -vf /dev/rmt/0 "a*"
See man pax for more details (it can read tar and cpio format and is used by ignite-UX)
Regards.