“tar ./files.tar -C $HOME” results in a “tar: invalid option — .” error

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm trying to run a tar command and I keep getting this odd error.



The command:



 tar ./files.tar -C $HOME


And I get this in return:



 Error: tar: invalid option -- '.'


My files.tar folder is located correctly near my script and contains some directories.



Any ideas?







share|improve this question


























    up vote
    0
    down vote

    favorite












    I'm trying to run a tar command and I keep getting this odd error.



    The command:



     tar ./files.tar -C $HOME


    And I get this in return:



     Error: tar: invalid option -- '.'


    My files.tar folder is located correctly near my script and contains some directories.



    Any ideas?







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to run a tar command and I keep getting this odd error.



      The command:



       tar ./files.tar -C $HOME


      And I get this in return:



       Error: tar: invalid option -- '.'


      My files.tar folder is located correctly near my script and contains some directories.



      Any ideas?







      share|improve this question














      I'm trying to run a tar command and I keep getting this odd error.



      The command:



       tar ./files.tar -C $HOME


      And I get this in return:



       Error: tar: invalid option -- '.'


      My files.tar folder is located correctly near my script and contains some directories.



      Any ideas?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 16 '17 at 13:10









      Jeff Schaller

      32.1k849109




      32.1k849109










      asked Oct 16 '17 at 11:46









      Wolfyaskingstuff

      113




      113




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          Add the options before the file name and so:



          tar -xf files.tar -C $HOME





          share|improve this answer






















          • This just returns another error: tar: "C: Cannot open: No such file or directory"
            – Wolfyaskingstuff
            Oct 16 '17 at 11:55










          • Are you trying to extract the tar file files.tar?
            – Raman Sailopal
            Oct 16 '17 at 11:56






          • 2




            The order of x and f must match the order of the arguments they are referring to. So tar xfC files.tar $HOME.
            – Johan Myréen
            Oct 16 '17 at 11:57










          • Yes I am. But extract them in the home directory.
            – Wolfyaskingstuff
            Oct 16 '17 at 11:57










          • @JohanMyréen That worked!
            – Wolfyaskingstuff
            Oct 16 '17 at 11:59










          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f398388%2ftar-files-tar-c-home-results-in-a-tar-invalid-option-error%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote



          accepted










          Add the options before the file name and so:



          tar -xf files.tar -C $HOME





          share|improve this answer






















          • This just returns another error: tar: "C: Cannot open: No such file or directory"
            – Wolfyaskingstuff
            Oct 16 '17 at 11:55










          • Are you trying to extract the tar file files.tar?
            – Raman Sailopal
            Oct 16 '17 at 11:56






          • 2




            The order of x and f must match the order of the arguments they are referring to. So tar xfC files.tar $HOME.
            – Johan Myréen
            Oct 16 '17 at 11:57










          • Yes I am. But extract them in the home directory.
            – Wolfyaskingstuff
            Oct 16 '17 at 11:57










          • @JohanMyréen That worked!
            – Wolfyaskingstuff
            Oct 16 '17 at 11:59














          up vote
          3
          down vote



          accepted










          Add the options before the file name and so:



          tar -xf files.tar -C $HOME





          share|improve this answer






















          • This just returns another error: tar: "C: Cannot open: No such file or directory"
            – Wolfyaskingstuff
            Oct 16 '17 at 11:55










          • Are you trying to extract the tar file files.tar?
            – Raman Sailopal
            Oct 16 '17 at 11:56






          • 2




            The order of x and f must match the order of the arguments they are referring to. So tar xfC files.tar $HOME.
            – Johan Myréen
            Oct 16 '17 at 11:57










          • Yes I am. But extract them in the home directory.
            – Wolfyaskingstuff
            Oct 16 '17 at 11:57










          • @JohanMyréen That worked!
            – Wolfyaskingstuff
            Oct 16 '17 at 11:59












          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          Add the options before the file name and so:



          tar -xf files.tar -C $HOME





          share|improve this answer














          Add the options before the file name and so:



          tar -xf files.tar -C $HOME






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 16 '17 at 12:01

























          answered Oct 16 '17 at 11:51









          Raman Sailopal

          1,18117




          1,18117











          • This just returns another error: tar: "C: Cannot open: No such file or directory"
            – Wolfyaskingstuff
            Oct 16 '17 at 11:55










          • Are you trying to extract the tar file files.tar?
            – Raman Sailopal
            Oct 16 '17 at 11:56






          • 2




            The order of x and f must match the order of the arguments they are referring to. So tar xfC files.tar $HOME.
            – Johan Myréen
            Oct 16 '17 at 11:57










          • Yes I am. But extract them in the home directory.
            – Wolfyaskingstuff
            Oct 16 '17 at 11:57










          • @JohanMyréen That worked!
            – Wolfyaskingstuff
            Oct 16 '17 at 11:59
















          • This just returns another error: tar: "C: Cannot open: No such file or directory"
            – Wolfyaskingstuff
            Oct 16 '17 at 11:55










          • Are you trying to extract the tar file files.tar?
            – Raman Sailopal
            Oct 16 '17 at 11:56






          • 2




            The order of x and f must match the order of the arguments they are referring to. So tar xfC files.tar $HOME.
            – Johan Myréen
            Oct 16 '17 at 11:57










          • Yes I am. But extract them in the home directory.
            – Wolfyaskingstuff
            Oct 16 '17 at 11:57










          • @JohanMyréen That worked!
            – Wolfyaskingstuff
            Oct 16 '17 at 11:59















          This just returns another error: tar: "C: Cannot open: No such file or directory"
          – Wolfyaskingstuff
          Oct 16 '17 at 11:55




          This just returns another error: tar: "C: Cannot open: No such file or directory"
          – Wolfyaskingstuff
          Oct 16 '17 at 11:55












          Are you trying to extract the tar file files.tar?
          – Raman Sailopal
          Oct 16 '17 at 11:56




          Are you trying to extract the tar file files.tar?
          – Raman Sailopal
          Oct 16 '17 at 11:56




          2




          2




          The order of x and f must match the order of the arguments they are referring to. So tar xfC files.tar $HOME.
          – Johan Myréen
          Oct 16 '17 at 11:57




          The order of x and f must match the order of the arguments they are referring to. So tar xfC files.tar $HOME.
          – Johan Myréen
          Oct 16 '17 at 11:57












          Yes I am. But extract them in the home directory.
          – Wolfyaskingstuff
          Oct 16 '17 at 11:57




          Yes I am. But extract them in the home directory.
          – Wolfyaskingstuff
          Oct 16 '17 at 11:57












          @JohanMyréen That worked!
          – Wolfyaskingstuff
          Oct 16 '17 at 11:59




          @JohanMyréen That worked!
          – Wolfyaskingstuff
          Oct 16 '17 at 11:59

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398388%2ftar-files-tar-c-home-results-in-a-tar-invalid-option-error%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)