This thread is about using tar & other compression utilities on AIX ;
- Find out which version of tar you are using
thanks to bakunin
>what $(which tar)
/usr/bin/tar:
61 1.14 src/bos/usr/ccs/lib/libc/__threads_init.c, libcthrd, bos53 0 7/11/00 12:04:14
10 1.49.1.75 src/bos/usr/bin/tar/tar.c, cmdarch, bos53A, a2004_38A1 8/ 31/04 07:07:20
92 1.7 src/bos/usr/ccs/lib/libIN/eprintf.c, libIN, bos530 6/10/91 10:23:13
>lslpp -L |grep -i tar
devices.scsi.tm.rte 5.3.0.10 C F SCSI Target Mode Software
devices.ssa.tm.rte 5.3.0.0 C F Target Mode SSA Support
tar 1.14-2 C R A GNU file archiving program.
>tar --version
tar: Not a recognized flag: -
Usage: tar -{c|r|t|u|x} [ -BdDEFhilmopRUsvw ] [ -Number ] [ -f TarFile ]
[ -b Blocks ] [ -S [ Feet ] | [ Feet@Density ] | [ Blocksb ] ]
[ -L InputList ] [-X ExcludeFile] [ -N Blocks ] [ -C Directory ] File ...
Usage: tar {c|r|t|u|x} [ bBdDEfFhilLXmNopRsSUvw[0-9] ] ]
[ Blocks ] [ TarFile ] [ InputList ] [ ExcludeFile ]
[ [ Feet ] | [ Feet@Density ] | [ Blocksb ] ] [-C Directory ] File ...
> find / -name tar
/opt/freeware/bin/tar
/usr/bin/tar
/usr/linux/bin/tar
- GNU Tar
why it is important to know which version of tar you are using ?
# tar cvf - file | gzip > file.tar.gz
tar: 0511-825 The file 'file' is too large.
AIX tar has a 2 GB limit to the file size. On UNIX tar there are some limits: avg. 12 GB of file archive (may vary depend of UNIX flavor), 6 level of directories (all UNIX, but not GNU tar), 32k directories on one level (this is a limitation of JFS and JFS2) Use tar from the Linux Toolbox CD - can get it alternatively here: https://www14.software.ibm.com/webapp/iwm/web/reg/download.do?source=tbxsrc&lang=en\_US&S_PKG=tar&cp=UTF-8
or
Welcome to Bull AIX freeware site
ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/tar/tar-1.14-2.aix5.1.ppc.rpm
Procedure
Find the native AIX tar location.
#which tar
/usr/bin/tar
Move the native binary tar command:
#cd /usr/bin
#mv tar tar_
Install the GNU tar, which can be obtained from the AIX toolbox site: IBM AIX Toolbox download information
Set the install location to be something similar to /opt/freeware/bin/tar
Create a gnu tar soft link:
ln -s /opt/freeware/bin/tar /usr/bin/tar
Validate that the tar command is gnu tar:
#tar --version
- Popular Tar options
-c = create
-f = read to/from the named file (instead of the device /tape)
-t = list contents of .tar file
-r = append to a .tar file
-v = verbose (tells you everything its doing)
-x = extract contents of .tar file
-z = compress files
- tar: 0511-169 A directory checksum error on media ; 804399360 not equal to 12401.
Solution : Gunzip tar A directory checksum error on media
-
How to find if particular file is present in the tar file ?
-
How to find the size of particular file in the tar file ?