SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2007
    Location
    Best, Netherlands
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Looking for the right tar command (unix)

    I have a tar archive with (as example) the following files in it:

    rene
    rene/index.html
    rene/test.html
    rene/plaatje.jpg
    rene/bestanden
    rene/bestanden/test.jpg
    rene/bestanden/index.html

    I'm looking for the right tar command to extra just the index.html files with their full file path, so in my example:

    rene/index.html
    rene/bestanden/index.html

    Is this possible with tar?

    Thanks in advance.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2007
    Location
    Ballarat, Vic. Australia
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by joomlaguy View Post
    I have a tar archive with (as example) the following files in it:

    rene
    rene/index.html
    rene/test.html
    rene/plaatje.jpg
    rene/bestanden
    rene/bestanden/test.jpg
    rene/bestanden/index.html

    I'm looking for the right tar command to extra just the index.html files with their full file path, so in my example:

    rene/index.html
    rene/bestanden/index.html

    Is this possible with tar?

    Thanks in advance.
    You can specify the filename on the commandline with wildcards. So, for example if your tar archive was named rene.tar, the command to just extract the index.html files in the correct paths would be:

    tar xf rene.tar *index.html*


Bookmarks

Posting Permissions

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