How to get total file in linux?

Linux OS Topics
Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

How to get total file in linux?

Post by Saman » Wed Dec 21, 2011 9:33 pm

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.
Post Reply

Return to “Linux”