write a shell script to read a directory path from command line. count how many files are there in the directory
Answers
Answered by
0
Answer:
I don't know
Explanation:
I don't know
Answered by
1
Answer:
(note that it doesn't count hidden files and assumes that file names don't contain newline characters).
To include hidden files (except . and ..) and avoid problems with newline characters, the canonical way is:
find . ! -name . -prune -print | grep -c /
Or recursively:
find .//. ! -name . -print | grep -
Similar questions