Answers: <p>Find is a command in Windows that does very different thing to find in a posix shell.</p>
  
  <p>And that would be the error you would get if you ran the Windows find (usually Windows find is located at <code>C:\Windows\System32\find.exe</code></p>
  
Answers: CC BY-SA 4.0
Answers: 2020-02-29T06:56:04.327Z
Answers: 2020-02-29T06:56:04.327Z
Answers: hvindin
Answers: <p>Your PATH may have somehow changed and you're now hitting the Windows <code>find</code> instead of the *nix-compatible one.</p>
  
  <p>Try specifying the full path, i.e. <code>/usr/bin/find</code> (that's what I see on my windows bash shell when I check with <code>which find</code>) instead of just <code>find</code> in your build process command.</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-03-01T15:53:40.697Z
Answers: 2020-03-01T15:53:40.697Z
Answers: Dan Cornilescu
Body: <p>In the YAML file defining our ADO build pipeline we have the following section</p>
  
  <pre class="lang-yaml prettyprint-override"><code>- bash: |
      pip install pylint
      find preprocessing/ subtyping/ visualisations/ -name '*.py' | grep -v hmm | grep -v /test_ | sort | xargs pylint
    displayName: 'Run linter'
  </code></pre>
  
  <p>At some point in the last week this stopped working. It still works on an <code>ubuntu-latest</code> hosted agent, but on Windows (either <code>windows-latest</code> or <code>vs2017-win2016</code>) it now fails with the message</p>
  
  <blockquote>
    <p>FIND: Parameter format not correct</p>
  </blockquote>
  
  <p>We have not changed anything, but our build process now fails.</p>
  
  <ul>
  <li>What has changed to cause this failure? </li>
  <li>Why does it only fail on Windows?</li>
  <li>How might I diagnose the problem?</li>
  <li>Is there anything wrong with our call to bash's 'find' command?</li>
  </ul>
  
Tags: <azure-devops><azure-pipelines>
Title: 'find' command suddenly not working in windows hosted agents
UserDisplayName: dumbledad
ThreadText: # 'find' command suddenly not working in windows hosted agents
  
  (Asked by: username_0 on 2020-01-23)
  
  In the YAML file defining our ADO build pipeline we have the following section
  
  ```yaml
  - bash: |
      pip install pylint
      find preprocessing/ subtyping/ visualisations/ -name '*.py' | grep -v hmm | grep -v /test_ | sort | xargs pylint
    displayName: 'Run linter'
  
  ```
  
  At some point in the last week this stopped working. It still works on an `ubuntu-latest` hosted agent, but on Windows (either `windows-latest` or `vs2017-win2016`) it now fails with the message
  
  > FIND: Parameter format not correct
  
  We have not changed anything, but our build process now fails.
  
  * What has changed to cause this failure?
  * Why does it only fail on Windows?
  * How might I diagnose the problem?
  * Is there anything wrong with our call to bash's 'find' command?
  
  **Tags:** azure-devops, azure-pipelines
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-02-29. Score: 2
  
  Find is a command in Windows that does very different thing to find in a posix shell.
  
  And that would be the error you would get if you ran the Windows find (usually Windows find is located at `C:\Windows\System32\find.exe`
  
  
  ---
  
  ### Answer by username_2 on 2020-03-01. Score: 1
  
  Your PATH may have somehow changed and you're now hitting the Windows `find` instead of the \*nix-compatible one.
  
  Try specifying the full path, i.e. `/usr/bin/find` (that's what I see on my windows bash shell when I check with `which find`) instead of just `find` in your build process command.
  
  
  ---
  
  