How to run the linux ls -l command on current directory in C

1 Answer

0 votes
#include <stdio.h>
#include <stdlib.h>

int main () {
   system("ls -l" );

   return 0;
} 



/*
run:

total 20
-rwxr-xr-x 1 root root 16104 Dec 22 07:58 test
-rw-r--r-- 1 root root   171 Dec 22 07:58 test.c

*/

 



answered Dec 22, 2021 by avibootz
edited Sep 30, 2023 by avibootz

Related questions

1 answer 177 views
1 answer 215 views
1 answer 142 views
142 views asked May 9, 2023 by avibootz
1 answer 177 views
1 answer 105 views
...