oracle unix command

what does this command do?

tar -cf - asm | (cd /u01/app/oracle/product/11.1/;tar -xf - )
LVL 11
it-rexAsked:
Who is Participating?
 
arnoldConnect With a Mentor Commented:
tar -cf - asm creates an archive from data in asm and pipes it to standard output
tar -f - means the results will be output via standard output
 -c create
| () means treat the items in perenthesis as a single command.
cd means change to the directory
-xf - means extract the data from a file in this case the -f - means from the standard input stream.

The end result is that the data in asm is copied as is into /u01/app/oracle/product/11.1/asm

man tar
0
 
it-rexAuthor Commented:
If I need more info about |() what is it called?
0
 
arnoldCommented:
what do you mean.
| pipe means pass the data to the next application.
in the case of () this means that the data is being passed to the group which as your example shows it runs commands prior to the application that actually gets the data.
i.e. items in parenthesis are treated as a group.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
tangchunfengCommented:
same as

cp -R asm /u01/app/oracle/product/11.1/
0
 
arnoldCommented:
To slightly correct tangchunfeng, the cp will reflect the ownership of the copied files as those of the user running the copy while the tar | tar mechanism will maintain the original ownership/permissions.
i.e. tar | tar process is a mirror copy.
0
 
it-rexAuthor Commented:
Great thanks
0
All Courses

From novice to tech pro — start learning today.