- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- excluding files from a list
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
Discussions
Discussions
Forums
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
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
тАО07-30-2010 05:51 AM
тАО07-30-2010 05:51 AM
file A- one with the list of the files to be tarred and the file B -list of the files to be excluded from A before tarring.
Can any one help me on how to pass my exclude file list while tarring?
I know that linux has -X option but i am using HP systems and there is no -X option on HP.
Any help would be highly appreciated.
Solved! Go to Solution.
- Tags:
- tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2010 06:04 AM
тАО07-30-2010 06:04 AM
Re: excluding files from a list
Since you have an include and an exclude list in two files, construct a third file to pass along to 'tar'. The following assumes that the two input files are sorted. The output will be only lines from the first file that are not in the second file:
# comm -23 file1 file2 > file3
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2010 06:44 AM
тАО07-30-2010 06:44 AM
Re: excluding files from a list
comm is removing the files in the file2 list but not the directories.Is the any possible way to remove the directories also?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2010 06:58 AM
тАО07-30-2010 06:58 AM
Solution> comm is removing the files in the file2 list but not the directories.Is the any possible way to remove the directories also?
I think you mean a situation like this:
# cat f1
/path/to
/path/to/somefile
/path/to/someotherfile
file1
file2
file3
file4
file5
file6
# cat f2
/path/to
file1
file3
file5
...and then:
# grep -vF -f f2 f1
file2
file4
file6
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2010 07:03 AM
тАО07-30-2010 07:03 AM
Re: excluding files from a list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2010 07:34 AM
тАО07-30-2010 07:34 AM
Re: excluding files from a list
There is, if you install GNU "tar".
http://www.gnu.org/software/tar/
- Tags:
- gtar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2010 11:59 PM
тАО07-30-2010 11:59 PM
Re: excluding files from a list
Instead of tar, on 11.31 you can use pax:
pax -x pax -o graph=graph_file
- Tags:
- pax