Syntax for gtar

Posted on 2006-06-09
Last Modified: 2008-01-09
Trying to gtar directory and subdirectories.  Need to include long file names and maintain symbolic links and maintain permissions.  What is the syntax for command line?

Question by:xoxomos
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 45

Expert Comment

by:Kent Olsen
ID: 16870455
Hi xoxomos,

tar -cp {path} > archive

I think that gtar handles long file names automatically.
The default is to dump symlinks as symlinks.

Good Luck!
LVL 62

Accepted Solution

gheist earned 150 total points
ID: 16875726
tar cpf file.tar directory/

cpf - create archive, include permissions, use first parameter as result file, instead of using default tape

ans xpf prameter after to extract using permissions.

Assisted Solution

JJSmith earned 100 total points
ID: 16881975
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 62

Expert Comment

ID: 16882023

Basically for extra info on what parameters to avoid to keep scrits portabls...

Author Comment

ID: 16887482
Actually is Solaris and it doesn't seem to like tar -cp {path} > archive
LVL 62

Expert Comment

ID: 16889781
Not that way.

tar cpf - {path} > archive

i.e. one should use stdout instead of default tape for shell redirect to work.

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question