Get number of files in current directory in linux

You can use this command to get the list of the number of file in current directory

ls -1 ./ | wc -l
Or
ls -1 /var/log | wc -l
to get the number of files in /var/log

Leave a Reply

Your email address will not be published. Required fields are marked *