How can I use tar command to group files without compression?

tar does not compress by default, just don't add a compression option:

tar -cvf myfolder.tar myfolder

I am including Hennes' comment in my answer since it adds useful information:

TAR (tape archive) is originally a unix program used to create archives on tape. Since all devices are treated as files under unix it is easy not to write to a tape but to a file instead. This is usually done with the -f flag. The command tar cvf myfolder.tar myfolder means tar, create, verbose file filename_to_create what_to_tar. There is no compression in this anywhere. Tar archives (as files) where often compressed using the compress program and gained the extention .Z (e.g. file.tar.Z). Later on this got included in gtar with the z flag


The @terdon answer is right.

But I made a small mistake doing tar cvf myfolder.tar.gz myfolder. I wanted same ending names for the files in the same path tar.gz even when it's not compressed.

So, if you put something like .gz, .z at the end of the filename you're trying to tar, the tar app will understand you want to use some compression, and it will apply accordingly to what you put (gz = gzip).

So if you want to use a extension like that tar.gz, make sure to use the flag --no-auto-compress

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

Tags:

Linux

Tar