Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outputting tar to a File

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
How can I send the output of a tar listing to a log file?

I tried this and a few variations:
tar -tvf /dev/rmt/0 2>> tar.log

The results are that it creates a 0 byte file.

What can you suggest?

Thanks!
 
You're copying standard error only to your file. Get rid of the 2, ie:

tar -tvf /dev/rmt/0 >> tar.log

The >> also appends. If you just want to create and overwrite each time use just one >

HTH.
 
if you collect also error:
tar tvf /dev/rmt/0 >> tar.log 2>&1
nota: tar does not care about '-' in options-string


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top