title: Exclude hidden files and folders in linux find
body: <p>I am trying to exclude hidden files and folders when doing a <code>find</code> in linux.</p>
  
  <p>I have to exclude files or folders that start with a dot (.hidden) but also have to exclude folders that start with an @ (like @eaDir).</p>
  
  <p>So far I have the following command which seems to work but maybe there is a more elegant way?</p>
  
  <pre><code>find /path/to/start/search/ -not -path '*@eaDir*' -not -path "*/\.*" -type f -mtime -2 
  </code></pre>
  
  <p>I did see examples using regular expression like so: </p>
  
  <pre><code>find . \( ! -regex '.*/\..*' \) -type f
  </code></pre>
  
  <p>but not sure how I would also exclude <code>@eaDir</code> directories with the <code>-regex</code>option?</p>
  
  <p>I believe there can also be hidden files that start with two dots? like "..hidden"? Is this already covered with my command or would I simply add a third option like <code>-not -path "*/\..*"</code> to exclude those as well?</p>
  
  <p>Then I saw some examples of using <code>-prune</code> so that find won't descend in hidden directories, however I am unsure how I would use this correclty in my example. I would be interested in this to speed things up.</p>
  
  <p>Thanks!</p>