Operating System - HP-UX
1827293 Members
2779 Online
109717 Solutions
New Discussion

How to redirect the stdout of tar command

 
Ulisse Lusuardi_2
New Member

How to redirect the stdout of tar command

I'm working on HP-UX9.07 and I would capture in a file the stdout from the
command :
tar -cf /dev/rfd0 pathX

The following command
===> tar -cf /dev/rfd0 pathX > out_file
can I not use because generate "out_file" but
without the content of stdout.

With best regards
ulisse
2 REPLIES 2
Paul Heffels_1
Frequent Advisor

Re: How to redirect the stdout of tar command

Hi Ulisse,

First of all "tar cf" will not produce any output, "tar cvf" will. Second,
output won't be written to file descriptor 1 but to 2.

"tar cvf ./tarfile 2>/tmp/listing" will work for you
Paul Heffels_1
Frequent Advisor

Re: How to redirect the stdout of tar command

Sorry, the command was wrong. This is the right one:

tar cvf ./tarfile files 2>/tmp/listing