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 have a very large folder of 120,000+ files. and I need to move them to another location on my same machine (same partition).

I'd like to use the tar command to group them up as a single unit and then mv them to the end location.

What command do I need to run to tar them all together and not compress anything (I need the fastest result).

share|improve this question
    
Why use tar, and not just mv(1) the files? Or use cp(1) if you don't want to lose the originals? –  vonbrand Jan 11 '13 at 17:58

1 Answer 1

up vote 9 down vote accepted

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

share|improve this answer
    
Will that recursively add all subfolder and files in the tar? –  Serg Jan 8 '13 at 15:51
    
@Serg yes, it will. –  terdon Jan 8 '13 at 15:54
4  
Yes. -- 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, <b>c</b>reate, <b>v</b>erbose <b>f</b>ile 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 –  Hennes Jan 8 '13 at 15:55
    
I really appreciate you taking the time to write that. It's hard to find simple answers to linux commands as the man pages are somewhat insurmountable when you just want to get to work. :) –  Serg Jan 8 '13 at 15:59
    
Thanks. I usually try to answer in both short and long form. As in "yes/no it will [not] work" for the short one, and an explanation as to why as the longer answer. Having the background as to why often helps in the future. –  Hennes Jan 8 '13 at 16:01

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.