9951 explained code solutions for 126 technologies


lsCount number of files in a directory


ls -1 /tmp | wc -lctrl + c
/tmp

directory to count files in (including subdirectories)

-1

ensure there's only one line per file

wc -l

count number of lines outputted by ls (thus, number of files)