ren

Rename a file or directory without changing its parent directory while keeping terminal working paths consistent.

FilesVersion 1.2.3Stable
lil-terminal

Overview

Use ren when only the object name should change: the parent directory stays the same, terminal paths keep tracking the object, and an existing destination is replaced only with explicit -f.

Rename without changing location

Use ren only when the parent directory stays the same; use mov when the object must also change location.

Syntax

lil-terminal
ren [-f] <new> · <src> <new>

Reference

ren <new>

rename the current directory

ren <src> <new>

rename a file or directory

ren <src> <new> -f

rename over an existing file, link or empty directory

Why -f exists

Without -f, an existing destination is an error. Use -f only when the old destination is deliberately disposable, for example ren report.new report.txt -f. A file can replace a file or symbolic link; a directory can replace only an empty directory. A non-empty directory is never removed recursively by ren.

Names and safety

<new> is a name, not a path. Slashes, . and .. are rejected. Use mov when the parent directory must change.

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.

Rename a file or directory

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 ren
Minimum package

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

install ren -m
Exact public version

Install exactly this published version.

install ren -v 1.2.3
Check or update

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

upgrade ren
Remove module

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

install ren -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.

Rename a file or directory
cd \sandbox\tmp | pwd | ren draft.txt final.txt | cd .
README.txt
current.txt
draft.txt
new.txt

sandbox/tmp

README.txt
current.txt
final.txt
new.txt
Rename a file or directory
ren new.txt current.txt
Destination already exists
Rename over an existing file, link or empty directory
ren new.txt current.txt -f
README.txt
current.txt
draft.txt
Rename the current directory
cd \sandbox\workspace | ren archive | pwd
original.txt
replace.txt
updated.txt

sandbox/archive
Rename a file or directory
ren draft.txt nested/final.txt
Invalid name

File used in this example: sandbox/workspace/original.txt

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

alpha
beta
gamma

Related documentation

Current public release

v1.2.32026-08-08

Flat rename result

A successful rename now returns a compact flat listing instead of expanding a directory tree.