Home Recursively counting files in a Linux directory
Reply: 0

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: ¦

share|improve this question
  • 47
    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
  • 2
    @SkippyleGrandGourou Isn't it called a pipe? – DaveStephens Apr 14 '15 at 13:25
  • 19
    @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
  • 48
    @zenith I just call it Bob. – Christopher Aug 13 '15 at 15:05
  • 7
    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

20 Answers 20

active oldest votes
up vote 901 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.817954 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO