Find the answer to your Linux question:
Results 1 to 3 of 3
Hi Experts, I have been using the below command in Sun Solaris for tar the .tmp files tar -cvf temp.tar ./*/*.tmp But when I use the same command in Linux, ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    1

    Tar large files in linux

    Hi Experts,

    I have been using the below command in Sun Solaris for tar the .tmp files

    tar -cvf temp.tar ./*/*.tmp

    But when I use the same command in Linux, I got "Argument too long list" error. I know this is because of the ARGS_MAX setup in Linux.

    For workaround I used the below command, it printing all the files but at the end the tar has only few files not all of them.

    find ./*/ -name '*.tmp' -print0| xargs -0 tar -cvf temp.tar

    I dont knwo what may be the error in the above command. Please help.

    Thanks,
    Gally

  2. #2
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    When you have a large list of files, I'd archive them with cpio (I'm assuming that you want all the .tmp files from the current directory downwards):
    Code:
    find . -name '*.tmp' -print -depth | cpio -o >myarchive.cpio
    Use -ov instead of -o to list the files while cpio is archiving them. cpio is a much underrated (and underused) utility.

  3. #3
    Just Joined!
    Join Date
    Dec 2010
    Posts
    1
    thanks,was useful...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...