Solved

# tar -cpvzf /home/oracle/db112.tgz . tar: illegal option -- z

Posted on 2013-06-25
6
1,448 Views
Last Modified: 2013-06-26
Hi experts.

Aix 6.1 - as root I can't do this, any ideas?

# tar -cpvzf /home/oracle/db112.tgz .
tar: illegal option -- z
0
Comment
Question by:LindaC
6 Comments
 
LVL 9

Expert Comment

by:gt2847c
ID: 39276057
Looks like the built in AIX tar doesn't support the compression option.  You may have to go find a copy of GNU Tar or gzip the tar file.
0
 
LVL 8

Author Comment

by:LindaC
ID: 39276064
So how to execute is as tar -cvf <name>.tar?

What is the p for
What is the z for?
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 475 total points
ID: 39276070
Hi,

sad to say, but AIX' tar does not support the "-z" (=compress) option.

You could create your tar archive without this option and compress it afterwards, like

# tar -cpvf /home/oracle/db112.tar .
# compress /home/oracle/db112.tar

This will result in a compressed file /home/oracle/db112.tar.Z

AIX does not have gzip, so you must use "compress".

By the way, "-p" means "preserve permissions".

Alternatively, if you have root access and are allowed to install open source software you could get yourself GNU tar (which supports "-z") and install it.

It's here:

http://www.perzl.org/aix/index.php?n=Main.Tar

"gettext" is a prerequisite which you must install beforehand:

http://www.perzl.org/aix/index.php?n=Main.Gettext

Sorry, no better news!

wmp
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 9

Assisted Solution

by:gt2847c
gt2847c earned 25 total points
ID: 39276092
-p preserves permissions on the file, but that's on the extract
-z (in those versions of tar that support it) is use gzip compression

a .tgz file is a gzipped tar file (by convention)

so:

-c = create
-v = verbose
-f = specify output or input filename depending on operation

tar -cvf filename.tar /directory/

Will create a a filename.tar file from whatever is in /directory/
0
 
LVL 8

Author Closing Comment

by:LindaC
ID: 39276128
Thank you!
0
 
LVL 48

Expert Comment

by:Tintin
ID: 39277249
You can do the equivalent of:

tar -cpvzf /home/oracle/db112.tgz .

with

tar -cpvf - . | gzip -c >/home/oracle/db112.tgz
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now