Home Recursively counting files in a Linux directory

# Recursively counting files in a Linux directory

user9926
1#
user9926 Published in September 20, 2018, 1:18 pm

How can I recursively count files in a Linux directory?

I found this:

find DIR_NAME -type f ¦ wc -l


But when I run this it returns the following error.

find: paths must precede expression: ¦

• You are confusing the broken bar ¦ (ASCII 166) with the vertical bar | (ASCII 124) used for UNIX pipeline. – Skippy le Grand Gourou Jan 11 '14 at 13:14
• @SkippyleGrandGourou Isn't it called a pipe? – DaveStephens Apr 14 '15 at 13:25
• @DaveStephens Yes, it's also called that. It's also called a Sheffer stroke, verti-bar, vbar, stick, vertical line, vertical slash, bar, obelisk, glidus. – emlai Apr 22 '15 at 0:10
• @zenith I just call it Bob. – Christopher Aug 13 '15 at 15:05
• In RFC20 it's called "vertical line". "Pipe" is the name of the shell operator, rather than the name of the symbol. Just as * is the "asterisk" ASCII character, but "times" in some other contexts. – slim Jul 7 '17 at 9:42