ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Look in linux there are man pages that give detailed discription of all command of linux and linux programming.
To get the number of files you have to read the directory. Go to console and write.
man scandir
This will show you how to read the directory.
Also check "man readdir". After reading directory you will get the list of files in a structure that you will pass to the function. Its **namelist and you can see the name of the file from namelist->d_name now you can open each file using open command and then get a line and print it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.