In this project I tried to made of copy ls command with option -t -a of Linux
The ls command is used to list files or directories in Linux and other Unix-based operating systems.
ls -flags directory List files including hidden files
Type the ls -a command to list files or directories including hidden files or directories. In Linux, anything that begins with a . is considered a hidden file:
Type the ls -t command to list files or directories and sort by last modified date and time in descending order
And ls -at command to list files or directories including hidden files or directories and then will sort by last modified date and time in descending order
void my_ls(char** dirname, int indx, optn* flags_ls);
void read_Dir(char* dir, optn* flags) ;
void display_list(char** filenames, int size);
char** sort_lex(char** my_arr, int size);
char** sort_time(char** my_arr, int size, char* dirname);
void my_swap(char** a, char** b);
char** sort_timedirs(char** dirname, int size);
my_ls(char** dirname, int indx, optn* flags_ls - main ls function
read_Dir(char* dir, optn* flags) - read given a directory by flags
display_list(char** filenames, int size) - print all sorted files by flags
sort_lex(char** my_arr, int size) - sort file names list in lexicographical order
sort_time(char** my_arr, int size, char* dirname) - list files and dirs sort by last modified time
my_swap(char** a, char** b) - swap filenames in array
sort_timedirs(char** dirname, int size) - sort filenames in subdirectories. Find path to file then get last modified time. When user entered other directories from current.
To see how program works read MAKEFILE


