1

I am looking for a simple command in GNU/Linux to count all files in a directory beginning with pa.

I have already executed the command to show all the files beginning with pa which I used find /etc/file/magic -name "pa*" and it shows up 4.

However, I need a command to actually count this.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
Deirdre
  • 121

1 Answers1

0

Use a pipe to the word count command with the line option:

$ find /etc/file/magic -name "pa*" |wc -l