How can I execute this shellcode ls PathToDirectory > newFile.txt
in C to create a new file with the list of content of the directory.
I've tried but this gives me always an error. "ls: cannot access '>': No such file or directory"
I am using this code :
execl( "/bin/ls","ls","PathToTheDirectory" ,">","newFileTocreate.txt" , NULL);
Output:
ls: cannot access '>': No such file or directory newFileTocreate.txt
"Show the content of the directory"