LinuxQuestions.org
Visit Jeremy's Blog.
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, 02: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, 02:13 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
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, 02:14 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,921

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
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, 05:56 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
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 11:55 AM
Peoplesoft command representation in AIX -does not work in LINUX nishanthp82 Linux - Newbie 1 01-18-2012 06: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 07:33 PM
tar differences in Linux and AIX bspicer Linux - General 3 04-25-2002 07:16 AM


All times are GMT -5. The time now is 02:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration