0

Say you run tar -czvf some_folder_here and don't actually specify an output file, like tar -czvf some_output_file.tar some_folder_here.

Where does the file go?

I just ran this by accident, and the -v option made it clear that it did SOMETHING, but I'm not sure where it actually went (if it went anywhere at all).

4
  • Many years ago I learned that a non GNU tar without option f is trying to access a tape drive. GNU tar writes to STDOUT without f.
    – Cyrus
    Jul 23, 2014 at 20:08
  • Which version of tar are you using? the tar (GNU tar) 1.27.1 do not create any file for example
    – Hastur
    Jul 23, 2014 at 20:09
  • I tried to replicate it but in Ubuntu and I get a "tar: Cowardly refusing to create an empty archive" error. Jul 23, 2014 at 20:11
  • Solaris 11 says (tar czvf foo): "Missing filenames" and without option f it says: "/dev/rmt/0: No such device or address".
    – Cyrus
    Jul 23, 2014 at 20:22

1 Answer 1

0

With the way tar or any standard Unix command-line tool would parse that command line, you specified an output filename (the first thing after the f option) , it just happened to be the same name as some folder. You failed to specify any files to ingest.

Most flavors of tar would have done nothing, either because you didn't specify any files to ingest, or because Unix filesystem API semantics don't let your clobber a directory with a file (IIRC).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .