LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   simple question on shell script (https://www.linuxquestions.org/questions/linux-general-1/simple-question-on-shell-script-61323/)

gsbarry 05-23-2003 03:35 AM

simple question on shell script
 
How can know how many items(files) are inside a folder.

I can't find that "ls" outputs any information about how many files are inside the folder

jharris 05-23-2003 03:51 AM

Code:

ls | wc -l
Should do you, when ls is piped into another process it prints the files in a single column, wc -l (thats a lowercase L BTW) counts the number of lines it is given.

HTH

Jamie...

gsbarry 05-23-2003 04:09 AM

Thanks, this works


All times are GMT -5. The time now is 12:45 AM.