md

Create a folder and every missing directory along its path.

FilesVersion 1.2.2Stable
lil-terminal

Overview

Need a place for a website, images or backups? md project/assets/images creates the whole folder chain at once. No need to step into each parent directory first. Add -0755 to set permissions on the final folder; intermediate folders follow the hosting server’s default permissions. Unlike mf, this command creates directories, not files.

Build a directory structure in one step

Prepare a project with md project/assets/images, then create a document with mf project/README.txt. For a restricted final folder use md project/private -0700. Existing directories change permissions only when a mode is specified.

Syntax

lil-terminal
md <path> [-MODE|-m MODE]

Reference

md <path>

create a directory (and any missing directories in the path)

md <path> -0755

create the directory and set octal permissions

md <path> -m 0755

set permissions in UNIX mode format (with the mode option)

Nested paths

Prepare a project with md project/assets/images, then create a document with mf project/README.txt. For a restricted final folder use md project/private -0700. Existing directories change permissions only when a mode is specified.

Safety

The path is resolved from the current terminal directory. Existing files are never replaced by directories. After a successful change md returns the same compact flat view used by cd instead of expanding a recursive tree.

Directory modes

An explicit octal mode also applies to an existing final directory; without it, existing permissions are preserved.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Create a directory (and any missing directories in the path)

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install md
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install md -m
Exact public version

Install exactly this published version.

install md -v 1.2.2
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade md
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install md -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Create a directory (and any missing directories in the path)
cd \sandbox\tmp | md project/assets | md project/cache | cd project
project/
  assets/

project/
  assets/
  cache/

assets/
cache/
Create the directory and set octal permissions
md sandbox/tmp/private -0700
sandbox/
project/
Set permissions in UNIX mode format (with the mode option)
md sandbox/tmp/public -m 0755
sandbox/
project/
Create a directory (and any missing directories in the path)
md sandbox/tmp/first/second -0777
sandbox/
project/
Create a directory (and any missing directories in the path)
md \sandbox\README.txt\child
Directory creation failed

File used in this example: sandbox/tmp/README.txt

The example uses a file or directory from the protected /sandbox/ documentation workspace.

lil-terminal sandbox temporary workspace

Commands in the public documentation use this directory for disposable copies,
archives, uploads and files created during examples. Review destructive commands
before running them and restore the sandbox from the release package when needed.

Related documentation

Current public release

v1.2.22026-10-31

Production refinement

Current stable release of md. Create a folder and every missing directory along its path.