I have a question concerning linux commands. How do I count all the files that begin with letters from a to g?
|
|
|||||||||||||
|
|
You can do it with a one-line shell command:
You will see some messages about how |
|||||||||||||
|
|
GNU find can do that for you:
this finds all files (not directories) under |
||||
|
|
|
The GNU implementation of the
It tells to ignore all files that do not start with a character in the range Next run the output through The full command will thus be:
This solution will not recurs into subdirectories. |
|||||||
|
Why do it like this? Because you probably want the simplest answer; this one assumes you don't have to worry about not counting directories, nor searching sub-directories, nor upper-case filenames... and this is the command I most often use. |
|||
|

