Skip to content

🧮Recursively count files in a directory by extension

Notifications You must be signed in to change notification settings

kpg-anon/extcount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

📁 extcount.py 📁

overview

extcount.py recursively counts the total number and combined size of all files per extension within a directory and prints the results to console in separate frames.

🛠️ Requirements 🛠️

  • Python ≥3.7
  • rich ≥10.1.0
  • argparse ≥1.4.0

📥 Installation 📥

  1. Download the script manually or clone the repository:

    git clone https://github.com/kpg-anon/extcount
  2. Navigate into the directory:

    cd extcount
  3. Install the dependencies:

    pip install -r requirements.txt

💻 Usage 💻

By default, the current working directory will be used if none is provided. The optional -e flag is used to specify one or multiple comma-separated extensions.

Example:

./extcount.py -e jpg,mp4 <folder path>

This will print out the total number of .jpg and .mp4 files in the specified folder path, as well as their combined size.

screenshot

TODO

  • add optional flag to specify depth
  • add functionality to print extension counts by subfolder

Releases

No releases published

Packages

No packages published

Languages