Minimal recode of ls executable in C
-l : list files informations.
> ./my_ls -l
-rw-r--r-- 1 dam dam 306 Jan 24 09:31 Makefile
-rw-r--r-- 1 dam dam 129 Jan 24 16:27 README.md
-rwxr-xr-x 1 dam dam 22976 Jan 24 16:28 my_ls
drwxr-xr-x 1 dam dam 52 Jan 24 08:43 src-a : include hidden files.
> ./my_ls -a
. .. .git .gitignore .vscode Makefile README.md my_ls src-r : reverse the output.
> ./my_ls -r
src my_ls README.md Makefile-t : sort by time.
> ./my_ls -t
README.md my_ls Makefile srcYou can also combine multiples flags.
> ./my_ls -la
> ./my_ls -l -a -t
You can also specify the path.
> ./my_ls -l ..
> ./my_ls -a -r ~ .. /home
Clone the repository or download it.
Use the Makefile to build the binary
> make # build the binary
> make re # rebuild if it exists
> make clean # clean the tmp file
> make fclean # clean all, also the binaryThen you can use it !
> ./my_ls
Makefile README.md my_ls srcdam, github : quidam213