I'm looking for a script that counts files in the current directory (excluding sub directories). It should iterate through each file and if not a directory increment a count. The output should just be an integer representing the number of files.I've come up withfind . -type f | wc -lBut I don't really think it does the whole counting bit. This is for an assignment so if you only want point me in the right direction that would be great.
script to count files in a directory
shell script;files;find