How to display count of files in current directory ?

If you work with files and folders in Linux then sometimes there is need to display count of files in current directory. You can do so easily with simple command in terminal.

If you’re using ubuntu then open up the directory and go to the specific directory using terminal and type the following command.

ls -1 | wc –l

What this command does is it -1 force to show each file in new line and –l is parameter of the word count.

Leave a comment

Powered by WP Hashcash