Sample Header Ad - 728x90

Unpacking a tarball via terminal like the Finder

4 votes
1 answer
191 views
If I have a .tar or .tgz or .tbz on my desktop, and I double click on it, I get the folder that was compressed, neatly decompressed right next to the archive file. Just like you'd expect. When I try to decompress a tarred item via the tar command, the output I get has the whole full path of the original compressed file. So for example, if I make a .tbz out of a folder on my desktop called "foo", and then I decompress it via tar -xf foo.tbz ~/Desktop/foo, what I get is: /Users/[user]/Desktop/foo/Users/[user]/desktop/foo/bar.txt Is there some magic flag in tar that I'm not seeing? I've googled up 'how-to' after 'how-to' that give you a simple tar command to extract a file, but all the directions I see give me my undesired result with long, unnecessary, super-nested result directors.
Asked by l008com (1835 rep)
Mar 20, 2019, 03:08 PM
Last activity: Nov 5, 2019, 07:25 AM