A tiny shell utility to quickly create files or directories with optional --dir and --dry-run flags.
mkfile is a simple command-line tool that automates file and directory creation. It creates parent directories automatically and supports a dry-run mode for previewing commands before execution.
mkfile [--dry-run] [--dir] path1 [path2 ...]Options:
--dirCreate directories instead of files (usesmkdir -p)--dry-runPrint the commands that would be executed without running them--helpShow help message and exit
mkfile notes/todo.txt
# Creates 'notes/' if missing and an empty file 'todo.txt'
mkfile --dir src include
# Creates 'src/' and 'include/' directories
mkfile --dry-run data/input.txt
# Prints mkdir/touch commands without running them
Clone the directory using git clone and then:
cp mkfile ~/.local/bin/mkfile
chmod +x ~/.local/bin/mkfileEnsure
~/.local/binis in your PATH.
- Parent Directories are created automatically when making files.
- When using
--dir, only directories are created. - Multiple paths can be specified in one command.
Licensed under the MIT License