*! version 1.0.1 22June2026

fm — File classification manager

fm classifies files in a specified directory by their first
English character and moves them into corresponding alphabetical
subdirectories. This is useful for keeping personal ado directories,
project folders, or any file collection tidy and easy to navigate.

Syntax

fm [directory_path] [, replace dryrun]

If directory_path is omitted, the current working directory
(c(pwd)) is used.

Description

fm scans all files (not subdirectories) in the target directory
and moves each file into a subdirectory named after the lowercase
first character of its filename. Three category groups determine the
target location:

a–z

Files starting with an English letter (case-insensitive).
For example, Apple.do and apple.ado both go to a/.

0-9

Files starting with a digit.
For example, 123data.csv goes to 0-9/.

_other

Files starting with any other character — dots, underscores, Chinese
characters, symbols, etc.
For example, .hiddenfile, _config.json, and 数据.txt
all go to _other/.

Options

replace specifies that existing files in the destination
subdirectory may be overwritten. The default behavior is to skip files
that already exist in the target subdirectory and display a warning.

dryrun runs the program in preview mode. The planned file moves
are displayed to the screen, but no files or directories are actually
created, copied, or erased. Use this to see what would happen before
committing to changes.

Examples

Organize all files in a specific personal ado directory:

fm D:/Stata18/ado/personal/

Preview what would happen in the current directory:

fm , dryrun

Organize a project folder, overwriting any existing files:

fm ./myproject/ , replace

Organize the current working directory with replace:

fm , replace

Remarks

fm only processes files at the top level of the target directory.
Subdirectories and their contents are ignored.

Category subdirectories (a/ through z/, 0-9/, and _other/) are
automatically created as needed. They will not be created if no files
require a particular category.

Hidden files (those whose names begin with a dot) are placed in the
_other/ category.

Files that share the same name and target category will collide.
Without the replace option, the second and subsequent occurrences
are skipped with a warning. Use replace to overwrite them.

Authors

Wu Lianghai

School of Business, Anhui University of Technology (AHUT)

Ma'anshan, Anhui, China

agd2010@yeah.net

Chen Liwen

School of Business, Anhui University of Technology (AHUT)

Ma'anshan, Anhui, China

2184844526@qq.com

Wu Hanyan

School of Economics and Management, NUAA

Nanjing, Jiangsu, China

2325476320@qq.com

Version

fm.ado v1.0.1, 22June2026.

Also see

dir mkdir copy erase