Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to set up a script to download and untar some sources in a build script, but for some maddening reason tar seems to have gone insane, where it constantly attempts to do something with some long-gone folder.

Initially I was attempting to

curl -L | tar -C assets -xz

And I got a confusing I stripped it way down to tar x (which shouldn't really do anything, but at least not die like it does), I get the truly inexplicable error:

$ tar x
tar: ~/Projects/Tape-Worms/: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

...Tape-Worms is some old project I was working on (and the folder no longer exists), and I have no idea how tar is a) pulling that path out of thin air, then b) choking on it. It doesn't matter what folder I'm in, /, ~, I get the exact same error.

share|improve this question
up vote 2 down vote accepted

tar apparently uses the variable TAPE as a default file path, and I had it set to the offending ~/Projects/Tape-Worms/ in my .bashrc for a shortcut. Naturally.

     The behavior of tar is controlled by the following environment variables, among 

     TAPE    Device or file to use for the archive if --file is not specified.  If 
             this environment variable is unset, use stdin or stdout instead.


$ unset TAPE
$ tar x
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.