December 13 2016

How the get total file inside the folder

Tagged Under :

Linux
On Linux without the GUI (Gnome or KDE) if you want to know how many files inside folder, you are unable to right click and select the properties to get the number of files inside the folder.

You can use below command to get number of files inside the folder
find . -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn
Above command can use in CentOS and Ubuntu.

The result will look like below.

Make a Comment

*

code