These C programs emulate some Unix commands. They were made by me in 2022 to practice C language. My implementations do not claim to be an alternative to the original ones.
Showing an example of ls
- Compile the executable:
gcc ls.c -o ls - Run the executable:
./ls /insert/your/dirname/here- Enjoy!
ls [-al] [file]lsonly accepts a single file or directory as an argument, although in Unix it is possible to accept more than one;-aoption completely mimics the original one: it displays all files and directories starting with a dot;-loption mimics the-1option from the original. It displays all files and directories line by line.
tail [+-n] [file1] [file2] [file3] ... [fileN];tailaccepts multiple files as an argument;-noption displaysnlast lines (n = 10by default);+noption displays file from then-th line.
This repository is open for contributing. So feel free to open issues and make pull requests.