Count files in a folder

A quick BASH command to count the number of files in a folder with a specific search term:

ls -d *searchterm* | wc -l

So for example, count all the shapefiles in a folder called spatialdata in your home folder:

~$ pwd
ls -d spatialdata/*shp* | wc -l

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

A Website.

Up ↑

%d bloggers like this: