Skip to content

nurbolatkz/Copy_ls_command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copy_ls_command

In this project I tried to made of copy ls command with option -t -a of Linux

Description

The ls command is used to list files or directories in Linux and other Unix-based operating systems.

img

How ls command works

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:

img

Type the ls -t command to list files or directories and sort by last modified date and time in descending order

img

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

Ls function and helper other function

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);

Explanation when these function used

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.

MAKE FILE

To see how program works read MAKEFILE

If you have any suggestions you are welcome :)

About

In this project I made copy of ls command of Linux

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors