Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /