4 ms·
This doesn't work. Try setting up a test directory as follows: touch first$'\n'file touch .hidden$'\n'file mkdir folder$'\n'. touch folder$'\n'
by chias 3y ago
This doesn't work. Try setting up a test directory as follows:
touch first$'\n'file
touch .hidden$'\n'file
mkdir folder$'\n'.
touch folder$'\n'./another$'\n'file
There are two files in the folder, or three if you want to count files in subdirectories too.
Your solution incorrectly outputs 7.