Ads

Check out Abanoub's 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, read my newer tech posts here.