Find the answer to your Linux question:
Results 1 to 3 of 3
Gday, quick question, how would i go about taring multiple file types, such as *.doc *.pdf *.txt i know that i can use the command Code: tar -zcvf filename.tar.gz /location/of/backup ...
  1. #1
    Linux Newbie
    Join Date
    Jul 2005
    Location
    Australia (Down Under)
    Posts
    141

    tar multiple file types eg *.doc *.txt

    Gday,

    quick question, how would i go about taring multiple file types, such as *.doc *.pdf *.txt

    i know that i can use the command
    Code:
     tar -zcvf filename.tar.gz /location/of/backup *.doc
    , but how do i include multiple wild cards?


    thanks
    Linux is the OS of tomorrow, Here today!!

  2. #2
    Linux User
    Join Date
    Feb 2006
    Posts
    484
    tar vcfz backup.tar.gz *.{doc,txt,any} -C /location/of/backup

    or

    tar vcfz backup.tar.gz *.[doc,txt,any] -C /location/of/backup

  3. #3
    Linux Newbie
    Join Date
    Jul 2005
    Location
    Australia (Down Under)
    Posts
    141
    thanks for your reply, this seems to only work in the specified directory (parent directory) and none of the folders inside this one (child directories). Is there a way to include the (.doc & .txt ) files for example, in the child directories.

    thanks
    Linux is the OS of tomorrow, Here today!!

Posting Permissions

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