Little copy of 'ls' Unix command written in C language.
You will need a C compiler, I recommend using GCC Gnu Compiler.
You need to compile it with -lbsd
flag
gcc main.c -o main.out -lbsd
./ls.out # show files in the current directory
./ls.out <path> # show files in specified directory
./ls.out -a <path> # show all files including hidden one
./ls.out -l <path> # show files with long listing format
./ls.out -R <path> # show files and list subdirectories recursively
./ls.out -n <path> # like -l, but list numeric user and group IDs
./ls.out -G <path> # in a long listing, don't print group names
Yes, all formats shown below will work
./ls.out -alR
./ls.out -a -R -l -nG