Untar an archive in the directory it is currently at (without noting destination path)Extrat tar “Cannot...

How to tell someone I'd like to become friends without letting them think I'm romantically interested in them?

Which star / galaxy is moving away from us the fastest?

How do native German speakers usually express skepticism (using even) about a premise?

Why isn't pressure filtration popular compared to vacuum filtration?

Was I subtly told to resign?

What to do with a rabbit in a survival situation?

What is the measurable difference between dry basil and fresh?

When an electron changes its spin, or any other intrinsic property, is it still the same electron?

Switching interface VLAN ID Mid-Production

When I press the space bar it deletes the letters after it

How can a dictatorship government be beneficial to a dictator in a post-scarcity society?

The tensor product of two monoidal categories

Why would non-kinetic weapons be used for orbital bombardment?

Why was hardware diversification an asset for the IBM PC ecosystem?

Optimization terminology: "Exact" v. "Approximate"

Why do we need common sense in AI?

How to befriend private nested class

How do we handle pauses in a dialogue?

What's the point of having a RAID 1 configuration over incremental backups to a secondary drive?

Credit score and financing new car

What steps should I take to lawfully visit the United States as a tourist immediately after visiting on a B-1 visa?

Is "De qui parles-tu" (for example) as formal as it is in English, or is it normal for the French to casually say that

Salt, pepper, herbs and spices

Why do people keep referring to Leia as Princess Leia, even after the destruction of Alderaan?



Untar an archive in the directory it is currently at (without noting destination path)


Extrat tar “Cannot open: File name too long”Untar Without Top-Level DirectoryHow to download an archive and extract it without saving the archive to disk?How to extract a single file from tbzhow to add files from a folder to archive instead of the folders itself?How to untar safely, without polluting the current directory in case of a tarbomb?Untar subfolders with initial folder's content in linuxHow to prepend a directory to files placed in a tar archive?Remove the pathname when extracting and archiving files that end with .log from /var/logFind tar archives inside subdirectories with bash script






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















While in ~/public_html I ran:



tar -zxvf example.com/extensions/MobileFrontend-REL1_32-9b48b3c.tar.gz


I assumed the untarred directory (named MobileFrontend) would appear under example.com/extensions (the directory in which its archive is currently at) but instead it appeared in ~/public_html.



How to untar an archive in the directory it is currently at (without noting destination path)?










share|improve this question

























  • Some versions of tar have a -C directory option that changes the directory. You can use this and the dirname command to produce extract(){ local t=$1; shift ; tar -zxvf "$t" -C "$(dirname "$t")" "$@" ; } but I wouldn't bother unless I was doing it a lot

    – icarus
    41 mins ago


















0















While in ~/public_html I ran:



tar -zxvf example.com/extensions/MobileFrontend-REL1_32-9b48b3c.tar.gz


I assumed the untarred directory (named MobileFrontend) would appear under example.com/extensions (the directory in which its archive is currently at) but instead it appeared in ~/public_html.



How to untar an archive in the directory it is currently at (without noting destination path)?










share|improve this question

























  • Some versions of tar have a -C directory option that changes the directory. You can use this and the dirname command to produce extract(){ local t=$1; shift ; tar -zxvf "$t" -C "$(dirname "$t")" "$@" ; } but I wouldn't bother unless I was doing it a lot

    – icarus
    41 mins ago














0












0








0








While in ~/public_html I ran:



tar -zxvf example.com/extensions/MobileFrontend-REL1_32-9b48b3c.tar.gz


I assumed the untarred directory (named MobileFrontend) would appear under example.com/extensions (the directory in which its archive is currently at) but instead it appeared in ~/public_html.



How to untar an archive in the directory it is currently at (without noting destination path)?










share|improve this question
















While in ~/public_html I ran:



tar -zxvf example.com/extensions/MobileFrontend-REL1_32-9b48b3c.tar.gz


I assumed the untarred directory (named MobileFrontend) would appear under example.com/extensions (the directory in which its archive is currently at) but instead it appeared in ~/public_html.



How to untar an archive in the directory it is currently at (without noting destination path)?







tar






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 35 mins ago







JohnDoea

















asked 1 hour ago









JohnDoeaJohnDoea

461 gold badge11 silver badges42 bronze badges




461 gold badge11 silver badges42 bronze badges













  • Some versions of tar have a -C directory option that changes the directory. You can use this and the dirname command to produce extract(){ local t=$1; shift ; tar -zxvf "$t" -C "$(dirname "$t")" "$@" ; } but I wouldn't bother unless I was doing it a lot

    – icarus
    41 mins ago



















  • Some versions of tar have a -C directory option that changes the directory. You can use this and the dirname command to produce extract(){ local t=$1; shift ; tar -zxvf "$t" -C "$(dirname "$t")" "$@" ; } but I wouldn't bother unless I was doing it a lot

    – icarus
    41 mins ago

















Some versions of tar have a -C directory option that changes the directory. You can use this and the dirname command to produce extract(){ local t=$1; shift ; tar -zxvf "$t" -C "$(dirname "$t")" "$@" ; } but I wouldn't bother unless I was doing it a lot

– icarus
41 mins ago





Some versions of tar have a -C directory option that changes the directory. You can use this and the dirname command to produce extract(){ local t=$1; shift ; tar -zxvf "$t" -C "$(dirname "$t")" "$@" ; } but I wouldn't bother unless I was doing it a lot

– icarus
41 mins ago










1 Answer
1






active

oldest

votes


















1














You'd have to change to that directory or specify it with -C . Tar extracts to the current directory by default.



cd example.com/extensions ; tar -zxvf ./MobileFrontend-REL1_32-9b48b3c.tar.gz


or



tar -zxv -C example.com/extensions -f example.com/extensions/MobileFrontend-REL1_32-9b48b3c.tar.gz





share|improve this answer


























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f529313%2funtar-an-archive-in-the-directory-it-is-currently-at-without-noting-destination%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    You'd have to change to that directory or specify it with -C . Tar extracts to the current directory by default.



    cd example.com/extensions ; tar -zxvf ./MobileFrontend-REL1_32-9b48b3c.tar.gz


    or



    tar -zxv -C example.com/extensions -f example.com/extensions/MobileFrontend-REL1_32-9b48b3c.tar.gz





    share|improve this answer




























      1














      You'd have to change to that directory or specify it with -C . Tar extracts to the current directory by default.



      cd example.com/extensions ; tar -zxvf ./MobileFrontend-REL1_32-9b48b3c.tar.gz


      or



      tar -zxv -C example.com/extensions -f example.com/extensions/MobileFrontend-REL1_32-9b48b3c.tar.gz





      share|improve this answer


























        1












        1








        1







        You'd have to change to that directory or specify it with -C . Tar extracts to the current directory by default.



        cd example.com/extensions ; tar -zxvf ./MobileFrontend-REL1_32-9b48b3c.tar.gz


        or



        tar -zxv -C example.com/extensions -f example.com/extensions/MobileFrontend-REL1_32-9b48b3c.tar.gz





        share|improve this answer













        You'd have to change to that directory or specify it with -C . Tar extracts to the current directory by default.



        cd example.com/extensions ; tar -zxvf ./MobileFrontend-REL1_32-9b48b3c.tar.gz


        or



        tar -zxv -C example.com/extensions -f example.com/extensions/MobileFrontend-REL1_32-9b48b3c.tar.gz






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 39 mins ago









        L. Scott JohnsonL. Scott Johnson

        4141 silver badge8 bronze badges




        4141 silver badge8 bronze badges






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f529313%2funtar-an-archive-in-the-directory-it-is-currently-at-without-noting-destination%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

            Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

            Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...