1

I want to create tar file on Solaris (Solaris 10 ) as Kit.tar

and untar the Kit.tar on Linux machine ( linux red-hat 3/4/5 )

Can we be safe with that untar process on Linux machine? ,

I want to be sure that all files (binaries and files) that extract from Solaris ( as tar cvf Kit.tar * )

will be exactly on the Linux machine ( as tar xvf Kit.tar )

SYNOPSIS from the MAN page

on Linux

   tar <operation> [options]

   Operations:
   [-]A --catenate --concatenate
   [-]c --create
   [-]d --diff --compare
   [-]r --append
   [-]t --list
   [-]u --update
   [-]x --extract --get
   --delete

on Soalris

 tar c[BDeEFhilnopPqTvw@[0-7]][bfk][X...] [blocksize]
     [tarfile] [size] [exclude-file]...
     {file | -I include-file | -C directory file}...

3 Answers 3

3

Sure, that will be OK - tar files are not tied to a single platform.

1

TL;DR; — yes, tar files are fairly standard, you will be able to handle them on a wide range of UNIX-like systems. This is so unless you use GNU-specific tar extensions in your files. See http://www.gnu.org/software/tar/manual/html_node/Extensions.html for details.

Console options might be different — this is due to the fact Solaris'es tar relates to bsdtar, while most Linux distributions use GNU utilities. See this question for details: https://unix.stackexchange.com/questions/101561/what-are-the-differences-between-bsdtar-and-gnu-tar

linux red-hat 3/4/5

Do you mean Red Hat Enterprise Linux 3/4/5? Red Hat Linux was RHEL's predecessor back in the 1990s and early 2000s. See http://en.wikipedia.org/wiki/Red_Hat_Linux for details

1

When going in the direction from Solaris --> Linux it is generally okay to create with Sun's tar and then extract with Linux tar (aka GNU tar). This is because GNU tar is a superset of Sun's tar.

But to be safe you should really make it a habit to always to use GNU Tar on Solaris, in particular if you are unpacking something that originates from another platform, say Linux. (meaning going in the opposite direction)

GNU Tar is installed by default in Solaris 10 and later. On Solaris 10 you'll find it in /usr/sfw/bin/gtar.

Personally I've made it a habit to always use the gtar command on Solaris in favor of the tar command. Then you don't have to think about it.

3
  • Actually, the gtar command can be the unsafe one, as GNU tar did not by default create a POSIX-compliant tar archive. You can also have problems reading a GNU tar archive on BSD and MacOS: gnu.org/software/tar/manual/html_node/Formats.html "Format used by GNU tar versions up to 1.13.25. This format derived from an early POSIX standard, adding some improvements such as sparse file handling and incremental archives. Unfortunately these features were implemented in a way incompatible with other archive formats." Jun 1, 2015 at 11:37
  • Hmm. It doesn't matter much if GNU tar isn't doing things "by the book" (the book being POSIX). If everyone is using GNU tar - even if GNU tar is painting outside the lines - then I'm of the impression that things will always work. GNU tar is always compatible with self, right?
    – peterh
    Jun 1, 2015 at 13:14
  • Everyone isn't using GNU tar. Jun 4, 2015 at 16:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .