HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how can I 'tar' my source files
Operating System - HP-UX
1832978
Members
3131
Online
110048
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
Forums
Discussions
Discussions
Discussions
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
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
09-29-2004 11:47 AM
09-29-2004 11:47 AM
I'm trying to use tar to create a tar file that includes all the *.h and *.cpp files in all subdirectories and includes their relative path.
I thought I could do something like:
tar cvf backup.tar -c . *.h *.cpp
but this seems to ignore ' *.h *.cpp' and stores everything?
I'm lost.
I thought I could do something like:
tar cvf backup.tar -c . *.h *.cpp
but this seems to ignore ' *.h *.cpp' and stores everything?
I'm lost.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 11:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 04:02 PM
09-29-2004 04:02 PM
Re: how can I 'tar' my source files
Sunder is absolutely correct
tar -cvf backup.tar $(find . -name "*.h" -o -name "*.cpp" -print) will do
regards
SK
tar -cvf backup.tar $(find . -name "*.h" -o -name "*.cpp" -print) will do
regards
SK
Your imagination is the preview of your life's coming attractions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 04:42 PM
09-29-2004 04:42 PM
Re: how can I 'tar' my source files
hai guru sundar,
tar -cvf backup.tar $(find . -name "*.h" -o -name "*.cpp" -print) will not work here.
I will only get *.h header files only not *.cpp files.
while using -o option we have to use () on this as,
tar -cvf backup.tar $(find . \( -name "*.h" -o -name "*.cpp" \) -print)
It will work now.
Else simply as,
tar -cvf backup.tar `find . -name "*.h" -o -name "*.cpp"`
It will work there.
tar -cvf backup.tar $(find . -name "*.h" -o -name "*.cpp" -print) will not work here.
I will only get *.h header files only not *.cpp files.
while using -o option we have to use () on this as,
tar -cvf backup.tar $(find . \( -name "*.h" -o -name "*.cpp" \) -print)
It will work now.
Else simply as,
tar -cvf backup.tar `find . -name "*.h" -o -name "*.cpp"`
It will work there.
Easy to suggest when don't know about the problem!
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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP