- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Create a tar ball in a different directory than wh...
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
09-05-2002 12:06 PM
09-05-2002 12:06 PM
1.) cd /usr/local/job (I want to tar up the contents of this directory)
2.) tar cvf ??????? (What else do I need here)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 12:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 12:10 PM
09-05-2002 12:10 PM
Re: Create a tar ball in a different directory than what I want to tar
Use it as follows:
tar cvf /path/to/file.tar /usr/local/job
With this command you can be anywhere, but be advised it will ONLY extract to /usr/local/job
Else you can do this relative as follows:
cd /usr/local
tar cvf /path/to/file.tar ./job
This will create a tarball that looks like
./job/xxxxxx that can be extracted into anywhere
OR even
cd /usr/local/job
tar cvf /path/to/file.tar .
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 12:10 PM
09-05-2002 12:10 PM
Re: Create a tar ball in a different directory than what I want to tar
relative
cd /usr/local
tar -cf /tmp/file.tar job
absolute
tar -cf /tmp/file.tar /usr/local/job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 12:11 PM
09-05-2002 12:11 PM
Re: Create a tar ball in a different directory than what I want to tar
2. tar -cvf /tmp/newtarfile.tar *
the -f tells it what file to write to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 12:12 PM
09-05-2002 12:12 PM
Re: Create a tar ball in a different directory than what I want to tar
cd /usr/local/job
tar cvf /different_dir/tarfile_name .
This will create your tarball in /different_dir/tarfile_name. the " ." at the end of the tar command says to select the current directory. All files in /usr/local/job and it's sub-directories will be included.
This will also create the tarball with relative pathnames. That's always a good idea because you can easily extract it to a new location.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 12:14 PM
09-05-2002 12:14 PM
Re: Create a tar ball in a different directory than what I want to tar
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 12:17 PM
09-05-2002 12:17 PM
Re: Create a tar ball in a different directory than what I want to tar
Of if you want to be in the directory where the tarball is to be created, you could do it this way:
cd /tmp; tar cf job.tar -C /usr/local/job .
or
cd /tmp; tar cf job.tar -C /usr/local job
or add a little compression:
cd /tmp; tar cf - -C /usr/local job | gzip -c > job.tgz
You get the idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2002 11:06 PM
09-08-2002 11:06 PM
Re: Create a tar ball in a different directory than what I want to tar
cd /dir_old
tar -cf - . | (cd /dir_new; tar -xf -)