Page 1 of 1

How to get total file in linux?

Posted: Wed Dec 21, 2011 9:33 pm
by Saman
Here is the command to do this.

Code: Select all

ls -1 targetdir | wc -l
If you need the file total for current drive, you can omit targetdir.