Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

When I issue the following command:

gunzip -c /disk1/hadoop/gunzip_tmp/in/part-00006.gz>>/disk1/hadoop/gunzip_tmp/outfile.000

I get the following stderr:

gunzip: /disk1/hadoop/gunzip_tmp/in/part-00006.gz>>/disk1/hadoop/gunzip_tmp/outfile.000.gz: No such file or directory

I have verified that the input file and the output directory /disk1/hadoop/gunzip_tmp exist. I thought >> would create the file if it didn't already exist. What am I doing wrong?

share|improve this question
up vote 1 down vote accepted

You need to add spaces around your >>. Your shell thinks you have one really long filename /disk1/hadoop/gunzip_tmp/in/part-00006.gz>>/disk1/hadoop/gunzip_tmp/outfile.000 and is not seeing the >> or the second filename.

you should write:

gunzip -c /disk1/hadoop/gunzip_tmp/in/part-00006.gz >> /disk1/hadoop/gunzip_tmp/outfile.000

Notice the spaces around >>

share|improve this answer
That works from the command line, but fails as script. The following command lines: UZPCMD="gunzip -c "$TMPDIR"/in/"$FILEONLY" >> "$TMPDIR"/outfile.000" echo $TMPDIR echo $FILEONLY echo $UZPCMD produce the following output - the gunzip command line looks as it should: /disk1/hadoop/gunzip_tmp part-00006.gz gunzip -c /disk1/hadoop/gunzip_tmp/in/part-00006.gz >> /disk1/hadoop/gunzip_tmp/outfile.000 However, issuing the command line from the script: $UZPCMD sends line after line of the unzipped file to stdout (as if redirect were ignored). – MarkP Feb 14 '12 at 20:18
@MarkP Then that is a different question than what you asked. Please close out the question and ask a new one, where you can properly format the script. – Rich Homolka Feb 14 '12 at 20:21
Apart from accepting an answer, is there anything I need to do to close out the question? – MarkP Feb 14 '12 at 20:32
@MarkP not really, just create a new question, with your new issue. – Rich Homolka Feb 14 '12 at 20:41

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.