Skip to content

A simple command-line utility to move files into folders based on their file extensions using Python's argparse.

Notifications You must be signed in to change notification settings

sudarshan710/cli-file-mover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ CLI File Mover

A simple command-line utility to move files into folders based on their file extensions using Python's argparse.


πŸš€ Features

  • βœ… Move files from a specified directory to subfolders by extension.
  • βœ… Automatically creates destination folders if they don't exist.
  • βœ… Lightweight and easy to use.

πŸ› οΈ Usage

python mover.py --sourcepath <source_path> --mapping <extension:folder> [<extension:folder> ...]

πŸ” Example

python mover.py --sourcepath "." --mapping ".png:images .pptx:ppt"

This will:

  • Move all .png files to the images/ directory
  • Move all .pptx files to the ppt/ directory
Argument Description Default
--sourcepath Source folder where files are located images/
--mapping Space-separated list of extension:folder pairs Required

πŸ“‹ Notes

  • File extensions are case-insensitive.
  • If a folder in --mapping does not exist, it will be created.
  • Files are moved, not copied.
  • Only regular files are processed (directories are ignored).

About

A simple command-line utility to move files into folders based on their file extensions using Python's argparse.

Topics

Resources

Stars

Watchers

Forks

Languages