LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-19-2014, 01:04 PM   #1
EricChiang
LQ Newbie
 
Registered: Jun 2014
Posts: 1

Rep: Reputation: Disabled
A useful tar command on AIX/Solaris does not seems work on Linux


Hi,
tar -cvpf - *|compress > file_name.tar.Z
zcat file_name.tar.Z|tar -xvpf -

Above 2 commands (tar & untar) are quite usful to handle my job.
Company has plan to switch unix plat form from AIX/Solaris to Linux in the near future.
How to make above tar & untar commands work in Lieux?
The tar comand above includes sub-folders in a huge main folder and includes all hidden files on all sub-folders.
Your help is highly appreciate.

Thanks! ---Eric
 
Old 06-19-2014, 01:13 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i usually use
Code:
tar -cvjf archive.tar.bz2 /whatever/floats/your/boat # archive and compress
tar -xvjf archive.tar.bz2 # extract
 
1 members found this post helpful.
Old 06-19-2014, 01:14 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,520

Rep: Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944
Quote:
Originally Posted by EricChiang View Post
Hi,
tar -cvpf - *|compress > file_name.tar.Z
zcat file_name.tar.Z|tar -xvpf -

Above 2 commands (tar & untar) are quite usful to handle my job. Company has plan to switch unix plat form from AIX/Solaris to Linux in the near future.
How to make above tar & untar commands work in Lieux? The tar comand above includes sub-folders in a huge main folder and includes all hidden files on all sub-folders. Your help is highly appreciate.
Thanks! ---Eric
If you're already a Unix administrator, you are no doubt familiar with the man pages; have you read the man page on the Linux tar command??
http://linux.die.net/man/1/tar

From what you posted, it seems like all you're after is the ability to compress/decompress the tar files...so:
Code:
-j, --bzip2
    filter the archive through bzip2 
-J, --xz
    filter the archive through xz 
-z, --gzip
    filter the archive through gzip 
...which gives you THREE options for file compress. So just adding a 'z' to your existing tar command will do it on Linux, no need for piping to compress. Same for uncompressing
 
Old 06-19-2014, 04:56 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,921

Rep: Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618
You'd have to also double check the version and maybe build of the tar you have. You may have two programs or more of tar.

Generally the man page follows correctly for the version.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
different between AIX and z/OS,what is different between AIX and solaris commandline llmi187 AIX 1 06-02-2012 10:55 AM
Peoplesoft command representation in AIX -does not work in LINUX nishanthp82 Linux - Newbie 1 01-18-2012 05:42 PM
how do i get a cronjob to run every two hours in AIX: 00 */2 * * * command no work boyd98 AIX 1 10-19-2009 06:33 PM
tar differences in Linux and AIX bspicer Linux - General 3 04-25-2002 06:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration