758
tar -vczfx123 ought to do it
(imgs.xkcd.com)
Post funny things about programming here! (Or just rant about your favourite programming language.)
Only works for tar.gz. Remember there's also tar.xz, tar.bz, tar.bz2 and half have their own extractor flag. FUN. It's usually J.
The post only calls for "a valid tar command", not that it has to work for any specific circumstance.
xaf
(extract a file) auto-detects the format.Extract Any File
Extract All Files
I don't remember the last time I had to worry about the compression. I simply run
tar xf myfile.tar.whatever
and it works every time.