What's wrong with this 'find' command?












14














I am executing the following command (to find all files with .ts extension and deleting them):



find . -type f -name "*.ts" –delete


An error shows up:



find: paths must precede expression: `–delete'


What have I done wrong?










share|improve this question









New contributor




Dorad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    14














    I am executing the following command (to find all files with .ts extension and deleting them):



    find . -type f -name "*.ts" –delete


    An error shows up:



    find: paths must precede expression: `–delete'


    What have I done wrong?










    share|improve this question









    New contributor




    Dorad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      14












      14








      14


      2





      I am executing the following command (to find all files with .ts extension and deleting them):



      find . -type f -name "*.ts" –delete


      An error shows up:



      find: paths must precede expression: `–delete'


      What have I done wrong?










      share|improve this question









      New contributor




      Dorad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I am executing the following command (to find all files with .ts extension and deleting them):



      find . -type f -name "*.ts" –delete


      An error shows up:



      find: paths must precede expression: `–delete'


      What have I done wrong?







      command-line delete find






      share|improve this question









      New contributor




      Dorad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Dorad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited yesterday









      Zanna

      50.2k13133241




      50.2k13133241






      New contributor




      Dorad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Jan 1 at 18:40









      Dorad

      1736




      1736




      New contributor




      Dorad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Dorad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Dorad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          35














          You have typographic sign instead of minus (-).



          Change your command to



          find . -type f -name "*.ts" -delete


          For complete syntax see man find:




          ACTIONS

                 -delete



                  Delete files; true if removal succeeded. If the removal failed, an error message is issued.

                  If -delete fails, find's exit status will be nonzero (when it eventually exits).

                  Use of -delete automatically turns on the -depth option.






          Be careful with copying and pasting commands from blogs and rich text processors. They may transform some typographic symbols to their plain text equivalents and vice versa.



          Consider to use simple text editors for the notes next time - use plain text, Markdown or reStructuredText.



          And as @AuxTaco mentioned - some blogs may rely on your copying to attack your computer.






          share|improve this answer



















          • 9




            And some blogs may rely on your copying to attack your computer.
            – AuxTaco
            2 days ago










          • In this particular case we do not know the source of this command. If original author wrongly had -- then engine converted it to . So we do not know the whole story :)
            – N0rbert
            2 days ago






          • 2




            I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
            – Dorad
            2 days ago






          • 1




            It's probably better to use Notepad++ in this situation, rather than Word.
            – Davidw
            2 days ago






          • 1




            Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
            – Joe
            yesterday











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          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
          });


          }
          });






          Dorad is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1106070%2fwhats-wrong-with-this-find-command%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









          35














          You have typographic sign instead of minus (-).



          Change your command to



          find . -type f -name "*.ts" -delete


          For complete syntax see man find:




          ACTIONS

                 -delete



                  Delete files; true if removal succeeded. If the removal failed, an error message is issued.

                  If -delete fails, find's exit status will be nonzero (when it eventually exits).

                  Use of -delete automatically turns on the -depth option.






          Be careful with copying and pasting commands from blogs and rich text processors. They may transform some typographic symbols to their plain text equivalents and vice versa.



          Consider to use simple text editors for the notes next time - use plain text, Markdown or reStructuredText.



          And as @AuxTaco mentioned - some blogs may rely on your copying to attack your computer.






          share|improve this answer



















          • 9




            And some blogs may rely on your copying to attack your computer.
            – AuxTaco
            2 days ago










          • In this particular case we do not know the source of this command. If original author wrongly had -- then engine converted it to . So we do not know the whole story :)
            – N0rbert
            2 days ago






          • 2




            I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
            – Dorad
            2 days ago






          • 1




            It's probably better to use Notepad++ in this situation, rather than Word.
            – Davidw
            2 days ago






          • 1




            Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
            – Joe
            yesterday
















          35














          You have typographic sign instead of minus (-).



          Change your command to



          find . -type f -name "*.ts" -delete


          For complete syntax see man find:




          ACTIONS

                 -delete



                  Delete files; true if removal succeeded. If the removal failed, an error message is issued.

                  If -delete fails, find's exit status will be nonzero (when it eventually exits).

                  Use of -delete automatically turns on the -depth option.






          Be careful with copying and pasting commands from blogs and rich text processors. They may transform some typographic symbols to their plain text equivalents and vice versa.



          Consider to use simple text editors for the notes next time - use plain text, Markdown or reStructuredText.



          And as @AuxTaco mentioned - some blogs may rely on your copying to attack your computer.






          share|improve this answer



















          • 9




            And some blogs may rely on your copying to attack your computer.
            – AuxTaco
            2 days ago










          • In this particular case we do not know the source of this command. If original author wrongly had -- then engine converted it to . So we do not know the whole story :)
            – N0rbert
            2 days ago






          • 2




            I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
            – Dorad
            2 days ago






          • 1




            It's probably better to use Notepad++ in this situation, rather than Word.
            – Davidw
            2 days ago






          • 1




            Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
            – Joe
            yesterday














          35












          35








          35






          You have typographic sign instead of minus (-).



          Change your command to



          find . -type f -name "*.ts" -delete


          For complete syntax see man find:




          ACTIONS

                 -delete



                  Delete files; true if removal succeeded. If the removal failed, an error message is issued.

                  If -delete fails, find's exit status will be nonzero (when it eventually exits).

                  Use of -delete automatically turns on the -depth option.






          Be careful with copying and pasting commands from blogs and rich text processors. They may transform some typographic symbols to their plain text equivalents and vice versa.



          Consider to use simple text editors for the notes next time - use plain text, Markdown or reStructuredText.



          And as @AuxTaco mentioned - some blogs may rely on your copying to attack your computer.






          share|improve this answer














          You have typographic sign instead of minus (-).



          Change your command to



          find . -type f -name "*.ts" -delete


          For complete syntax see man find:




          ACTIONS

                 -delete



                  Delete files; true if removal succeeded. If the removal failed, an error message is issued.

                  If -delete fails, find's exit status will be nonzero (when it eventually exits).

                  Use of -delete automatically turns on the -depth option.






          Be careful with copying and pasting commands from blogs and rich text processors. They may transform some typographic symbols to their plain text equivalents and vice versa.



          Consider to use simple text editors for the notes next time - use plain text, Markdown or reStructuredText.



          And as @AuxTaco mentioned - some blogs may rely on your copying to attack your computer.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday

























          answered Jan 1 at 18:43









          N0rbert

          21.4k547100




          21.4k547100








          • 9




            And some blogs may rely on your copying to attack your computer.
            – AuxTaco
            2 days ago










          • In this particular case we do not know the source of this command. If original author wrongly had -- then engine converted it to . So we do not know the whole story :)
            – N0rbert
            2 days ago






          • 2




            I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
            – Dorad
            2 days ago






          • 1




            It's probably better to use Notepad++ in this situation, rather than Word.
            – Davidw
            2 days ago






          • 1




            Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
            – Joe
            yesterday














          • 9




            And some blogs may rely on your copying to attack your computer.
            – AuxTaco
            2 days ago










          • In this particular case we do not know the source of this command. If original author wrongly had -- then engine converted it to . So we do not know the whole story :)
            – N0rbert
            2 days ago






          • 2




            I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
            – Dorad
            2 days ago






          • 1




            It's probably better to use Notepad++ in this situation, rather than Word.
            – Davidw
            2 days ago






          • 1




            Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
            – Joe
            yesterday








          9




          9




          And some blogs may rely on your copying to attack your computer.
          – AuxTaco
          2 days ago




          And some blogs may rely on your copying to attack your computer.
          – AuxTaco
          2 days ago












          In this particular case we do not know the source of this command. If original author wrongly had -- then engine converted it to . So we do not know the whole story :)
          – N0rbert
          2 days ago




          In this particular case we do not know the source of this command. If original author wrongly had -- then engine converted it to . So we do not know the whole story :)
          – N0rbert
          2 days ago




          2




          2




          I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
          – Dorad
          2 days ago




          I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
          – Dorad
          2 days ago




          1




          1




          It's probably better to use Notepad++ in this situation, rather than Word.
          – Davidw
          2 days ago




          It's probably better to use Notepad++ in this situation, rather than Word.
          – Davidw
          2 days ago




          1




          1




          Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
          – Joe
          yesterday




          Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
          – Joe
          yesterday










          Dorad is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Dorad is a new contributor. Be nice, and check out our Code of Conduct.













          Dorad is a new contributor. Be nice, and check out our Code of Conduct.












          Dorad is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Ask Ubuntu!


          • 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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2faskubuntu.com%2fquestions%2f1106070%2fwhats-wrong-with-this-find-command%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

          Список кардиналов, возведённых папой римским Каликстом III

          Deduzione

          Mysql.sock missing - “Can't connect to local MySQL server through socket”