.tar files without directory structure












28















I'm .taring some files with the path example/super_user/Output.*.



The resulting .tar looks like this:



+ example
+ super_user
- Output.zip
- Output.xml
- Output.txt


But I want the file to be like the following:



- Output.zip
- Output.xml
- Output.txt


Do you know how I can achieve this while still being in another directory?










share|improve this question

























  • Do make sure to avoid tarbombs with archives like that.

    – grawity
    Sep 30 '14 at 12:36
















28















I'm .taring some files with the path example/super_user/Output.*.



The resulting .tar looks like this:



+ example
+ super_user
- Output.zip
- Output.xml
- Output.txt


But I want the file to be like the following:



- Output.zip
- Output.xml
- Output.txt


Do you know how I can achieve this while still being in another directory?










share|improve this question

























  • Do make sure to avoid tarbombs with archives like that.

    – grawity
    Sep 30 '14 at 12:36














28












28








28


3






I'm .taring some files with the path example/super_user/Output.*.



The resulting .tar looks like this:



+ example
+ super_user
- Output.zip
- Output.xml
- Output.txt


But I want the file to be like the following:



- Output.zip
- Output.xml
- Output.txt


Do you know how I can achieve this while still being in another directory?










share|improve this question
















I'm .taring some files with the path example/super_user/Output.*.



The resulting .tar looks like this:



+ example
+ super_user
- Output.zip
- Output.xml
- Output.txt


But I want the file to be like the following:



- Output.zip
- Output.xml
- Output.txt


Do you know how I can achieve this while still being in another directory?







unix compression tar






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 30 '14 at 11:50









Der Hochstapler

67.5k49230284




67.5k49230284










asked Apr 18 '11 at 6:13







user36938




















  • Do make sure to avoid tarbombs with archives like that.

    – grawity
    Sep 30 '14 at 12:36



















  • Do make sure to avoid tarbombs with archives like that.

    – grawity
    Sep 30 '14 at 12:36

















Do make sure to avoid tarbombs with archives like that.

– grawity
Sep 30 '14 at 12:36





Do make sure to avoid tarbombs with archives like that.

– grawity
Sep 30 '14 at 12:36










8 Answers
8






active

oldest

votes


















11














tar will preserve the file and folder structure so I don't think there's any way to instruct tar to flatten the hierarchy at creation time.



One workaround is to temporarily change directory, create the tar, then go back - a quick example below:



cd example/super_user && tar -cvf ../../result.tar Output.* && cd ../..





share|improve this answer































    22














    If the directory 'example' is at the root of the filesystem, here's another way:



    tar -C /example/super_user -cvf result.tar .


    this will change directory to the point that you want to do the tar. The caveat is that if there are any subdirectories under /example/super_user, the directory structure will be preserved for these sub-directories.






    share|improve this answer





















    • 1





      This is the answer to the problem at hand. The mentioned caveat is not a problem in this case. All other answers are workarounds to account for variations to the problem.

      – joki
      Nov 30 '16 at 10:05











    • That's indeed the solution to this question. The directory doesn't have to be the root, supposing the directory structure /home/u/foo/bar, working dir is /home/b, then tar -C foo/bar -cvf qiz.tar . works well. One caveat though, is that you can't use wildcards, i.e. tar -C foo/bar -cvf qiz.tar *.log, tar -C foo/bar -cvf qiz.tar "*.log" or tar -C foo/bar -cvf qiz.tar "foo/bar/*.log" won't work.

      – Brice
      Sep 13 '18 at 9:26



















    9














    I've posted my answer here:



    https://stackoverflow.com/questions/13924856/unix-tar-do-not-preserve-directory-structure



    repost (for lazy ppl)





    This is ugly... but it works...



    I had this same problem but with multiple folders, I just wanted to flat every files out. You can use the option "transform" to pass a sed expression and... it works as expected.



    this is the expression:



    's/.*///g' (delete everything before '/')



    This is the final command:



    tar --transform 's/.*///g' -zcvf tarballName.tgz */*/*.info








    share|improve this answer

































      6














      To create a tar (ARCHIVE.tar) with all files from a directory (DIR), without any parent directory information (not even ./), you can use something like:



      find "DIR" -type f -printf "%fn" | xargs tar cf ARCHIVE.tar -C "DIR"


      You can play with the find to limit depth, select specific files, and many other things.



      Good Luck!






      share|improve this answer
























      • I'm getting "find: -printf: unknown primary or operator" at OSX find command. Any tips?

        – TCB13
        Feb 3 '13 at 15:55











      • -printf is a non standard command. Many of those only work with specific versions of find. Usually we mark those when answering a question on Super User (e.g. with "-blah is a Gnu extension and will not work everywhere").

        – Hennes
        Sep 19 '14 at 11:36



















      3














      I created a temp directory.
      And in the directory, created symbolic links to all of the files to the files to be included.
      Then I did tar -h -C . so that all the files (not links, but their content) are included in the archive with the desired name.






      share|improve this answer































        1














        If those are the entire contents of the tarball then you can use GNU tar's --strip-components option to remove the 2 levels before the files.






        share|improve this answer
























        • I've only got the option --strip-path but using it won't change anything.

          – user36938
          Apr 18 '11 at 7:12



















        1














        Another way to temporary change directory is to put the cd and tar commands inside parenthesis ( ):



        (cd example/super_user; tar -cvf ../../result.tar *)


        The advantage of this, is, you will always implicitly pop back to the original directory when the block is done. i.e. no need for pushd .. popd blocks or keeping track of where to cd back to.






        share|improve this answer































          0














          pushd example/super_user
          tar -cf output.tar Output.*
          popd


          pushd pushes the current directory path to the DIR stack and moves to content folder. Then, you move back to original directory by using popd.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            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: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2fsuperuser.com%2fquestions%2f272213%2ftar-files-without-directory-structure%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown
























            8 Answers
            8






            active

            oldest

            votes








            8 Answers
            8






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            11














            tar will preserve the file and folder structure so I don't think there's any way to instruct tar to flatten the hierarchy at creation time.



            One workaround is to temporarily change directory, create the tar, then go back - a quick example below:



            cd example/super_user && tar -cvf ../../result.tar Output.* && cd ../..





            share|improve this answer




























              11














              tar will preserve the file and folder structure so I don't think there's any way to instruct tar to flatten the hierarchy at creation time.



              One workaround is to temporarily change directory, create the tar, then go back - a quick example below:



              cd example/super_user && tar -cvf ../../result.tar Output.* && cd ../..





              share|improve this answer


























                11












                11








                11







                tar will preserve the file and folder structure so I don't think there's any way to instruct tar to flatten the hierarchy at creation time.



                One workaround is to temporarily change directory, create the tar, then go back - a quick example below:



                cd example/super_user && tar -cvf ../../result.tar Output.* && cd ../..





                share|improve this answer













                tar will preserve the file and folder structure so I don't think there's any way to instruct tar to flatten the hierarchy at creation time.



                One workaround is to temporarily change directory, create the tar, then go back - a quick example below:



                cd example/super_user && tar -cvf ../../result.tar Output.* && cd ../..






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 18 '11 at 16:45









                3498DB3498DB

                15.7k114762




                15.7k114762

























                    22














                    If the directory 'example' is at the root of the filesystem, here's another way:



                    tar -C /example/super_user -cvf result.tar .


                    this will change directory to the point that you want to do the tar. The caveat is that if there are any subdirectories under /example/super_user, the directory structure will be preserved for these sub-directories.






                    share|improve this answer





















                    • 1





                      This is the answer to the problem at hand. The mentioned caveat is not a problem in this case. All other answers are workarounds to account for variations to the problem.

                      – joki
                      Nov 30 '16 at 10:05











                    • That's indeed the solution to this question. The directory doesn't have to be the root, supposing the directory structure /home/u/foo/bar, working dir is /home/b, then tar -C foo/bar -cvf qiz.tar . works well. One caveat though, is that you can't use wildcards, i.e. tar -C foo/bar -cvf qiz.tar *.log, tar -C foo/bar -cvf qiz.tar "*.log" or tar -C foo/bar -cvf qiz.tar "foo/bar/*.log" won't work.

                      – Brice
                      Sep 13 '18 at 9:26
















                    22














                    If the directory 'example' is at the root of the filesystem, here's another way:



                    tar -C /example/super_user -cvf result.tar .


                    this will change directory to the point that you want to do the tar. The caveat is that if there are any subdirectories under /example/super_user, the directory structure will be preserved for these sub-directories.






                    share|improve this answer





















                    • 1





                      This is the answer to the problem at hand. The mentioned caveat is not a problem in this case. All other answers are workarounds to account for variations to the problem.

                      – joki
                      Nov 30 '16 at 10:05











                    • That's indeed the solution to this question. The directory doesn't have to be the root, supposing the directory structure /home/u/foo/bar, working dir is /home/b, then tar -C foo/bar -cvf qiz.tar . works well. One caveat though, is that you can't use wildcards, i.e. tar -C foo/bar -cvf qiz.tar *.log, tar -C foo/bar -cvf qiz.tar "*.log" or tar -C foo/bar -cvf qiz.tar "foo/bar/*.log" won't work.

                      – Brice
                      Sep 13 '18 at 9:26














                    22












                    22








                    22







                    If the directory 'example' is at the root of the filesystem, here's another way:



                    tar -C /example/super_user -cvf result.tar .


                    this will change directory to the point that you want to do the tar. The caveat is that if there are any subdirectories under /example/super_user, the directory structure will be preserved for these sub-directories.






                    share|improve this answer















                    If the directory 'example' is at the root of the filesystem, here's another way:



                    tar -C /example/super_user -cvf result.tar .


                    this will change directory to the point that you want to do the tar. The caveat is that if there are any subdirectories under /example/super_user, the directory structure will be preserved for these sub-directories.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Dec 19 '18 at 9:55









                    Pang

                    563611




                    563611










                    answered May 24 '12 at 8:59









                    Anthony WaltersAnthony Walters

                    22122




                    22122








                    • 1





                      This is the answer to the problem at hand. The mentioned caveat is not a problem in this case. All other answers are workarounds to account for variations to the problem.

                      – joki
                      Nov 30 '16 at 10:05











                    • That's indeed the solution to this question. The directory doesn't have to be the root, supposing the directory structure /home/u/foo/bar, working dir is /home/b, then tar -C foo/bar -cvf qiz.tar . works well. One caveat though, is that you can't use wildcards, i.e. tar -C foo/bar -cvf qiz.tar *.log, tar -C foo/bar -cvf qiz.tar "*.log" or tar -C foo/bar -cvf qiz.tar "foo/bar/*.log" won't work.

                      – Brice
                      Sep 13 '18 at 9:26














                    • 1





                      This is the answer to the problem at hand. The mentioned caveat is not a problem in this case. All other answers are workarounds to account for variations to the problem.

                      – joki
                      Nov 30 '16 at 10:05











                    • That's indeed the solution to this question. The directory doesn't have to be the root, supposing the directory structure /home/u/foo/bar, working dir is /home/b, then tar -C foo/bar -cvf qiz.tar . works well. One caveat though, is that you can't use wildcards, i.e. tar -C foo/bar -cvf qiz.tar *.log, tar -C foo/bar -cvf qiz.tar "*.log" or tar -C foo/bar -cvf qiz.tar "foo/bar/*.log" won't work.

                      – Brice
                      Sep 13 '18 at 9:26








                    1




                    1





                    This is the answer to the problem at hand. The mentioned caveat is not a problem in this case. All other answers are workarounds to account for variations to the problem.

                    – joki
                    Nov 30 '16 at 10:05





                    This is the answer to the problem at hand. The mentioned caveat is not a problem in this case. All other answers are workarounds to account for variations to the problem.

                    – joki
                    Nov 30 '16 at 10:05













                    That's indeed the solution to this question. The directory doesn't have to be the root, supposing the directory structure /home/u/foo/bar, working dir is /home/b, then tar -C foo/bar -cvf qiz.tar . works well. One caveat though, is that you can't use wildcards, i.e. tar -C foo/bar -cvf qiz.tar *.log, tar -C foo/bar -cvf qiz.tar "*.log" or tar -C foo/bar -cvf qiz.tar "foo/bar/*.log" won't work.

                    – Brice
                    Sep 13 '18 at 9:26





                    That's indeed the solution to this question. The directory doesn't have to be the root, supposing the directory structure /home/u/foo/bar, working dir is /home/b, then tar -C foo/bar -cvf qiz.tar . works well. One caveat though, is that you can't use wildcards, i.e. tar -C foo/bar -cvf qiz.tar *.log, tar -C foo/bar -cvf qiz.tar "*.log" or tar -C foo/bar -cvf qiz.tar "foo/bar/*.log" won't work.

                    – Brice
                    Sep 13 '18 at 9:26











                    9














                    I've posted my answer here:



                    https://stackoverflow.com/questions/13924856/unix-tar-do-not-preserve-directory-structure



                    repost (for lazy ppl)





                    This is ugly... but it works...



                    I had this same problem but with multiple folders, I just wanted to flat every files out. You can use the option "transform" to pass a sed expression and... it works as expected.



                    this is the expression:



                    's/.*///g' (delete everything before '/')



                    This is the final command:



                    tar --transform 's/.*///g' -zcvf tarballName.tgz */*/*.info








                    share|improve this answer






























                      9














                      I've posted my answer here:



                      https://stackoverflow.com/questions/13924856/unix-tar-do-not-preserve-directory-structure



                      repost (for lazy ppl)





                      This is ugly... but it works...



                      I had this same problem but with multiple folders, I just wanted to flat every files out. You can use the option "transform" to pass a sed expression and... it works as expected.



                      this is the expression:



                      's/.*///g' (delete everything before '/')



                      This is the final command:



                      tar --transform 's/.*///g' -zcvf tarballName.tgz */*/*.info








                      share|improve this answer




























                        9












                        9








                        9







                        I've posted my answer here:



                        https://stackoverflow.com/questions/13924856/unix-tar-do-not-preserve-directory-structure



                        repost (for lazy ppl)





                        This is ugly... but it works...



                        I had this same problem but with multiple folders, I just wanted to flat every files out. You can use the option "transform" to pass a sed expression and... it works as expected.



                        this is the expression:



                        's/.*///g' (delete everything before '/')



                        This is the final command:



                        tar --transform 's/.*///g' -zcvf tarballName.tgz */*/*.info








                        share|improve this answer















                        I've posted my answer here:



                        https://stackoverflow.com/questions/13924856/unix-tar-do-not-preserve-directory-structure



                        repost (for lazy ppl)





                        This is ugly... but it works...



                        I had this same problem but with multiple folders, I just wanted to flat every files out. You can use the option "transform" to pass a sed expression and... it works as expected.



                        this is the expression:



                        's/.*///g' (delete everything before '/')



                        This is the final command:



                        tar --transform 's/.*///g' -zcvf tarballName.tgz */*/*.info









                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited May 23 '17 at 12:41









                        Community

                        1




                        1










                        answered Sep 19 '14 at 11:17









                        Alessio ValentiniAlessio Valentini

                        19112




                        19112























                            6














                            To create a tar (ARCHIVE.tar) with all files from a directory (DIR), without any parent directory information (not even ./), you can use something like:



                            find "DIR" -type f -printf "%fn" | xargs tar cf ARCHIVE.tar -C "DIR"


                            You can play with the find to limit depth, select specific files, and many other things.



                            Good Luck!






                            share|improve this answer
























                            • I'm getting "find: -printf: unknown primary or operator" at OSX find command. Any tips?

                              – TCB13
                              Feb 3 '13 at 15:55











                            • -printf is a non standard command. Many of those only work with specific versions of find. Usually we mark those when answering a question on Super User (e.g. with "-blah is a Gnu extension and will not work everywhere").

                              – Hennes
                              Sep 19 '14 at 11:36
















                            6














                            To create a tar (ARCHIVE.tar) with all files from a directory (DIR), without any parent directory information (not even ./), you can use something like:



                            find "DIR" -type f -printf "%fn" | xargs tar cf ARCHIVE.tar -C "DIR"


                            You can play with the find to limit depth, select specific files, and many other things.



                            Good Luck!






                            share|improve this answer
























                            • I'm getting "find: -printf: unknown primary or operator" at OSX find command. Any tips?

                              – TCB13
                              Feb 3 '13 at 15:55











                            • -printf is a non standard command. Many of those only work with specific versions of find. Usually we mark those when answering a question on Super User (e.g. with "-blah is a Gnu extension and will not work everywhere").

                              – Hennes
                              Sep 19 '14 at 11:36














                            6












                            6








                            6







                            To create a tar (ARCHIVE.tar) with all files from a directory (DIR), without any parent directory information (not even ./), you can use something like:



                            find "DIR" -type f -printf "%fn" | xargs tar cf ARCHIVE.tar -C "DIR"


                            You can play with the find to limit depth, select specific files, and many other things.



                            Good Luck!






                            share|improve this answer













                            To create a tar (ARCHIVE.tar) with all files from a directory (DIR), without any parent directory information (not even ./), you can use something like:



                            find "DIR" -type f -printf "%fn" | xargs tar cf ARCHIVE.tar -C "DIR"


                            You can play with the find to limit depth, select specific files, and many other things.



                            Good Luck!







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Dec 11 '12 at 14:56









                            Paul BhullarPaul Bhullar

                            6111




                            6111













                            • I'm getting "find: -printf: unknown primary or operator" at OSX find command. Any tips?

                              – TCB13
                              Feb 3 '13 at 15:55











                            • -printf is a non standard command. Many of those only work with specific versions of find. Usually we mark those when answering a question on Super User (e.g. with "-blah is a Gnu extension and will not work everywhere").

                              – Hennes
                              Sep 19 '14 at 11:36



















                            • I'm getting "find: -printf: unknown primary or operator" at OSX find command. Any tips?

                              – TCB13
                              Feb 3 '13 at 15:55











                            • -printf is a non standard command. Many of those only work with specific versions of find. Usually we mark those when answering a question on Super User (e.g. with "-blah is a Gnu extension and will not work everywhere").

                              – Hennes
                              Sep 19 '14 at 11:36

















                            I'm getting "find: -printf: unknown primary or operator" at OSX find command. Any tips?

                            – TCB13
                            Feb 3 '13 at 15:55





                            I'm getting "find: -printf: unknown primary or operator" at OSX find command. Any tips?

                            – TCB13
                            Feb 3 '13 at 15:55













                            -printf is a non standard command. Many of those only work with specific versions of find. Usually we mark those when answering a question on Super User (e.g. with "-blah is a Gnu extension and will not work everywhere").

                            – Hennes
                            Sep 19 '14 at 11:36





                            -printf is a non standard command. Many of those only work with specific versions of find. Usually we mark those when answering a question on Super User (e.g. with "-blah is a Gnu extension and will not work everywhere").

                            – Hennes
                            Sep 19 '14 at 11:36











                            3














                            I created a temp directory.
                            And in the directory, created symbolic links to all of the files to the files to be included.
                            Then I did tar -h -C . so that all the files (not links, but their content) are included in the archive with the desired name.






                            share|improve this answer




























                              3














                              I created a temp directory.
                              And in the directory, created symbolic links to all of the files to the files to be included.
                              Then I did tar -h -C . so that all the files (not links, but their content) are included in the archive with the desired name.






                              share|improve this answer


























                                3












                                3








                                3







                                I created a temp directory.
                                And in the directory, created symbolic links to all of the files to the files to be included.
                                Then I did tar -h -C . so that all the files (not links, but their content) are included in the archive with the desired name.






                                share|improve this answer













                                I created a temp directory.
                                And in the directory, created symbolic links to all of the files to the files to be included.
                                Then I did tar -h -C . so that all the files (not links, but their content) are included in the archive with the desired name.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered May 20 '16 at 5:41









                                mzwtmzwt

                                311




                                311























                                    1














                                    If those are the entire contents of the tarball then you can use GNU tar's --strip-components option to remove the 2 levels before the files.






                                    share|improve this answer
























                                    • I've only got the option --strip-path but using it won't change anything.

                                      – user36938
                                      Apr 18 '11 at 7:12
















                                    1














                                    If those are the entire contents of the tarball then you can use GNU tar's --strip-components option to remove the 2 levels before the files.






                                    share|improve this answer
























                                    • I've only got the option --strip-path but using it won't change anything.

                                      – user36938
                                      Apr 18 '11 at 7:12














                                    1












                                    1








                                    1







                                    If those are the entire contents of the tarball then you can use GNU tar's --strip-components option to remove the 2 levels before the files.






                                    share|improve this answer













                                    If those are the entire contents of the tarball then you can use GNU tar's --strip-components option to remove the 2 levels before the files.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Apr 18 '11 at 6:27









                                    Ignacio Vazquez-AbramsIgnacio Vazquez-Abrams

                                    95.6k6152210




                                    95.6k6152210













                                    • I've only got the option --strip-path but using it won't change anything.

                                      – user36938
                                      Apr 18 '11 at 7:12



















                                    • I've only got the option --strip-path but using it won't change anything.

                                      – user36938
                                      Apr 18 '11 at 7:12

















                                    I've only got the option --strip-path but using it won't change anything.

                                    – user36938
                                    Apr 18 '11 at 7:12





                                    I've only got the option --strip-path but using it won't change anything.

                                    – user36938
                                    Apr 18 '11 at 7:12











                                    1














                                    Another way to temporary change directory is to put the cd and tar commands inside parenthesis ( ):



                                    (cd example/super_user; tar -cvf ../../result.tar *)


                                    The advantage of this, is, you will always implicitly pop back to the original directory when the block is done. i.e. no need for pushd .. popd blocks or keeping track of where to cd back to.






                                    share|improve this answer




























                                      1














                                      Another way to temporary change directory is to put the cd and tar commands inside parenthesis ( ):



                                      (cd example/super_user; tar -cvf ../../result.tar *)


                                      The advantage of this, is, you will always implicitly pop back to the original directory when the block is done. i.e. no need for pushd .. popd blocks or keeping track of where to cd back to.






                                      share|improve this answer


























                                        1












                                        1








                                        1







                                        Another way to temporary change directory is to put the cd and tar commands inside parenthesis ( ):



                                        (cd example/super_user; tar -cvf ../../result.tar *)


                                        The advantage of this, is, you will always implicitly pop back to the original directory when the block is done. i.e. no need for pushd .. popd blocks or keeping track of where to cd back to.






                                        share|improve this answer













                                        Another way to temporary change directory is to put the cd and tar commands inside parenthesis ( ):



                                        (cd example/super_user; tar -cvf ../../result.tar *)


                                        The advantage of this, is, you will always implicitly pop back to the original directory when the block is done. i.e. no need for pushd .. popd blocks or keeping track of where to cd back to.







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Sep 29 '16 at 1:39









                                        Stephen QuanStephen Quan

                                        1964




                                        1964























                                            0














                                            pushd example/super_user
                                            tar -cf output.tar Output.*
                                            popd


                                            pushd pushes the current directory path to the DIR stack and moves to content folder. Then, you move back to original directory by using popd.






                                            share|improve this answer




























                                              0














                                              pushd example/super_user
                                              tar -cf output.tar Output.*
                                              popd


                                              pushd pushes the current directory path to the DIR stack and moves to content folder. Then, you move back to original directory by using popd.






                                              share|improve this answer


























                                                0












                                                0








                                                0







                                                pushd example/super_user
                                                tar -cf output.tar Output.*
                                                popd


                                                pushd pushes the current directory path to the DIR stack and moves to content folder. Then, you move back to original directory by using popd.






                                                share|improve this answer













                                                pushd example/super_user
                                                tar -cf output.tar Output.*
                                                popd


                                                pushd pushes the current directory path to the DIR stack and moves to content folder. Then, you move back to original directory by using popd.







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Jul 4 '15 at 5:32









                                                Saravana KumarSaravana Kumar

                                                1




                                                1






























                                                    draft saved

                                                    draft discarded




















































                                                    Thanks for contributing an answer to Super User!


                                                    • 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%2fsuperuser.com%2fquestions%2f272213%2ftar-files-without-directory-structure%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

                                                    Plaza Victoria

                                                    In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                                                    How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...