Here is the C program to implement the LS command Used in Linux

Even though the GUI in the Linux has come a long way over the past few years, the terminal always beats the GUI in terms of its raw power and usability. One of the most commonly used Linux commands is the ls command. The “ls” is a Linus shell command is which is used to print all the files and directories in the present directory in the form of a list.

# ls

0001.pcap        Desktop    Downloads         index.html   install.log.syslog  Pictures  Templates
anaconda-ks.cfg  Documents  fbcmd_update.php  install.log  Music               Public    Videos

This command can also be used in many ways by just tweaking the letters and symbols with it. Some examples are:

-> ls -l (-l is a character, not one) shows file or directory, modified date and time, size, file or folder name and also owner of file and it’s permission.

-> To see the list including hidden files, use ls -a. 

-> Use -lh option to see sizes in human readable format.

Now that we know the usefulness of this command, its time for us to know what we came here for:

C program to implement the LS command

We hope you learnt something new today.

I do not claim the ownership of this code, as it was sourced form here.

Related posts

Water Facilities Must Secure Exposed HMIs – Warns CISA

Microsoft December Patch Tuesday Arrived With 70+ Bug Fixes

How to Improve Your Cyber Resilience by Strengthening User Privileges