2
votes
tar -zcpf backup.tar.gz -g files.snar /path/to/folder

creates a compressed archive of all the files under /path/to/folder. No issues there. However, I have no particular use for the backup.tar.gz file once I have the files.snar file.

How do I get tar to simply create files.snar and not the actual .gz file? Sure I can delete it later but it sounds like an unnecessary operation. I have attempted to play around with /dev/null but my knowledge of how it works is rather limited.

1
To my downvoters - what is the point in downvoting if you do not indicate what is wrong with the question? It was clear enough - I wanted the .snar without the actual archive. Either you knew the answer or you did not. -1'ing a question without commentary is at best unproductive.DroidOS
@JonathonReinhart The question you link to deals with a different facet of tar. It does not address the OP's question.RolfBly

1 Answers

2
votes

This works

tar -zcpf /dev/null -g files.snar /path/to/folder