Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to use tar to tar files before transfer, so I can keep the entire file path rather than losing it along the way. However, when I try to tar an empty folder, it tells me that it is cowardly refusing to create an empty archive. I want to keep the empty folder on the other end, but don't want to put anything else into the archive to make it non-empty. Is there any way to do this?

share|improve this question
1  
Works fine here. How are you doing it? –  Ignacio Vazquez-Abrams Apr 21 '10 at 1:58
add comment

1 Answer

up vote 2 down vote accepted

What command are you using? I am able to create a tar archive of an empty directory just fine:

[jnet@Stan tmp]$ mkdir test
[jnet@Stan tmp]$ tar -cf test.tar test
[jnet@Stan tmp]$ ls -lh test.tar 
-rw-r--r--  1 jnet  wheel    10K Apr 20 21:58 test.tar
share|improve this answer
    
Looking at your answer, I realized I forgot the first argument... so this is really just an ID10T error. Thanks for helping anyway! –  snostorm Apr 21 '10 at 2:03
    
You know it's cowardly to create an empty archive right? ;-) –  Josh Apr 21 '10 at 2:18
    
@josh: i'm pretty sure it was the refusal to create an empty archive that was "cowardly". tho i'm not remembering who says that. is that a tar error or somebody else? –  quack quixote Apr 21 '10 at 3:15
    
snostorm@ubuntu:~$ tar -cf filename tar: Cowardly refusing to create an empty archive Try tar --help' or tar --usage' for more information. –  snostorm Apr 21 '10 at 11:32
    
So that's a tar error. :) –  snostorm Apr 21 '10 at 11:33
show 1 more comment

Your Answer

 
discard

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.