Ads

Check out value in brief website for more up-to-date content.

how many text files in a directory ?

in Bash script or Linux terminal

%%bash

ls -l ~/Work/*.txt | wc -l

in Python

%%python3

from glob import glob

print(len(glob('/home/abanoub/Work/*.txt)))

If you want to get new posts, make sure to subscribe to Value In Brief by Email.