title: Using execl to run a Linux command
body: <p>I need to list all files in the current directory which have a permission of 644 by writing a C language program.
  I can not use <code>system()</code> and have to use <code>execl()</code> in order to use system calls.</p>
  
  <p>This a line that I used in my code:</p>
  
  <pre><code>execl("/usr/bin/find", "find . -maxdepth 1 -perm 644", (char *)NULL);
  </code></pre>
  
  <p>The problem is that the code is searching the whole disk instead of the current directory.
  Would you help me to fix it please?</p>
  
  <hr>
  
  <pre><code>        ...
  
          case 4:
              int status;
              switch (fork()){
                  case -1: quit ("fork",1);
                  case 0:
                  execl("/usr/bin/find","find","." ,"-maxdepth" ,"1","-perm", "644",(char *)NULL) ;
                  exit (200);
                  default:
                  wait(&amp;status);
                  exit(0);
              }
          }
  </code></pre>