Skip to content

Create files or directories from the command line, automatically making parent folders and supporting dry-run mode.

License

Notifications You must be signed in to change notification settings

zimmerman-dev/mkfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mkfile

A tiny shell utility to quickly create files or directories with optional --dir and --dry-run flags.


Overview

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.


Usage

mkfile [--dry-run] [--dir] path1 [path2 ...]

Options:

  • --dir Create directories instead of files (uses mkdir -p)
  • --dry-run Print the commands that would be executed without running them
  • --help Show help message and exit

Examples

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

Installation

Clone the directory using git clone and then:

cp mkfile ~/.local/bin/mkfile
chmod +x ~/.local/bin/mkfile

Ensure ~/.local/bin is in your PATH.


Notes

  • 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

About

Create files or directories from the command line, automatically making parent folders and supporting dry-run mode.

Resources

License

Stars

Watchers

Forks

Packages

No packages published