-1
$ tar -czvf 'liunx adventure group'/ liunx\ adventure\ group/
tar (child): liunx adventure group/: Cannot open: Is a directory
tar (child): Error is not recoverable: exiting now
liunx adventure group/
liunx adventure group/datapacks/
liunx adventure group/advancements/
liunx adventure group/advancements/f10933e2-6368-4ffd-9d45-47f80e324ea1.json
liunx adventure group/session.lock
liunx adventure group/data/
liunx adventure group/data/map_1.dat
liunx adventure group/data/villages_nether.dat
liunx adventure group/data/villages_end.dat
liunx adventure group/data/idcounts.dat
liunx adventure group/data/scoreboard.dat
liunx adventure group/data/villages.dat
liunx adventure group/data/map_0.dat
liunx adventure group/region/
liunx adventure group/region/r.0.-1.mca
tar: liunx adventure group/: Wrote only 2048 of 10240 bytes
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Is my command wrong?

4
  • Can you try this command: tar -czvf 'liunx_adventure_group.tar' liunx\ adventure\ group/, and post the output in the query above? You cannot have a file with the same name as the directory.
    – AmeyaVS
    Dec 20, 2018 at 7:46
  • it export a .tar file
    – Sam Lo
    Dec 20, 2018 at 7:48
  • 1
    You are specifying the same name for the zipped file as the directory name which you are trying to zip.
    – AmeyaVS
    Dec 20, 2018 at 7:49
  • thanks for you help , it's work now . i use gzip to compress it , next it create a .tar.gz file , is this a correct compress method ???
    – Sam Lo
    Dec 20, 2018 at 7:54

2 Answers 2

1

Like AmeyaVS hints -

You need to give the tar archive a name, not the directory. tar will NOT add .tar/.tgz to your archive.

tar (child): liunx adventure group/: Cannot open: Is a directory

says so, quite clearly.

Hint: you may not want to use -z (gzip) to compress. -J uses xz, which is a more modern compress.

0
1

Please run that command like this:

tar -czvf 'liunx adventure group'.tar.gzip liunx\ adventure\ group/

Don't use space in the compressed filename, so the above would be better like this:

tar -czvf liunx_adventure_group.tar.gzip liunx\ adventure\ group/

See man tar:

Compression options
       -a, --auto-compress
              Use archive suffix to determine the compression program.

       -I, --use-compress-program=COMMAND
              Filter  data  through  COMMAND.   It must accept the -d option, for decompression.  The argument can contain
              command line options.

       -j, --bzip2
              Filter the archive through bzip2(1).

       -J, --xz
              Filter the archive through xz(1).

       --lzip Filter the archive through lzip(1).

       --lzma Filter the archive through lzma(1).

       --lzop Filter the archive through lzop(1).

       --no-auto-compress
              Do not use archive suffix to determine the compression program.

       -z, --gzip, --gunzip, --ungzip
              Filter the archive through gzip(1).

Usage examples:

tar -czvf liunx_adventure_group.tar.gzip liunx\ adventure\ group/
tar -cjvf liunx_adventure_group.tar.bzip2 liunx\ adventure\ group/
tar -cJvf liunx_adventure_group.tar.xz liunx\ adventure\ group/
0

You must log in to answer this question.

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