int main () { pid_t pid; int status; pid = fork (); printf ("se executa ..\n"); if (pid < 0) { perror ("eroare la fork"); exit (1); } else if (pid) { if (wait (&status) < 0) { perror ("wait()"); } printf ("Comanda a fost executata.\n"); exit (0); } else { execlp ("ls", /* comanda de executat (se va cauta in direc$ "ls", "-a", "-l", NULL); printf ("Eroare de executie!\n"); exit (1); } } pt comanda ls ar fi bun codu asta ..de rulat ruleaza si imi afiseaza fisierele