Results 1 to 3 of 3

Thread: Extract full path form find

  1. #1
    Join Date
    May 2013
    Location
    Syria
    Beans
    124
    Distro
    Ubuntu Gnome 13.10 Saucy Salamander

    Extract full path form find

    Hello,

    I don't know how extract full path from find command to be able to uncompress each file it its path instead of current path
    Code:
    find . -iname '*.7z' -exec 7z e {} {} \;
    Last edited by mbnoimi; August 9th, 2013 at 06:39 PM.

  2. #2
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,430
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Extract full path form find

    Code:
    while read -rd $'\0' f; do 7z x -o"${f%/*}" "$f"; done < <( find . -iname '*.7z' -print0 )
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

  3. #3
    Join Date
    May 2013
    Location
    Syria
    Beans
    124
    Distro
    Ubuntu Gnome 13.10 Saucy Salamander

    Re: Extract full path form find

    Thanks a lot.

Tags for this Thread

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
  •