del

deletes files, symbolic links and directories

FilesVersion 1.2.2Stable
lil-terminal

Overview

del deletes files, symbolic links and directories. You can remove several paths in one call, such as del old.txt cache.tmp. Empty directories need no extra flag, but a directory with contents requires explicit -r or its equivalent -a.

Inspect before deleting

Locate your target with cd, dir or stat, then delete only the paths you intend. Recursive mode removes all contents below the chosen folder.

Syntax

lil-terminal
del <path>... [-r|-a] [-f]

Reference

del <file>

delete a file (or symbolic link)

del <dir>

delete an empty directory

del <path>...

delete multiple files and/or empty directories

del <dir> -r | del <dir> -a

delete a directory recursively

del <path>... -f

delete the listed paths without failing when some are already absent

del -- <path>

treat a path beginning with - as a filename

Notes

-f is not a permission override; it only skips paths that are already missing. That makes del missing.tmp -f useful in repeatable .lil scripts. Options apply to the whole target list. Use del -- -old.txt for a filename starting with a hyphen.

Safety

The filesystem root, the current working directory, the selected base and their parent paths are protected. A symbolic link is removed without traversing its target. There is no trash or undo, and a failure midway through multiple targets may leave partial deletions. Success prints the current directory listing.

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.

Delete a file (or symbolic link)

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

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

install del -m
Exact public version

Install exactly this published version.

install del -v 1.2.2
Check or update

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

upgrade del
Remove module

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

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

Delete a file (or symbolic link)
cd \sandbox\tmp | del draft.txt
README.txt
current.txt
new.txt
Delete an empty directory
cd \sandbox\tmp | @md temp-empty | del temp-empty
README.txt
current.txt
draft.txt
new.txt
temp-empty/

README.txt
current.txt
draft.txt
new.txt
Delete multiple files and/or empty directories
del \sandbox\tmp\draft.txt \sandbox\tmp\new.txt
README.txt
current.txt
Delete the listed paths without failing when some are already absent
del \sandbox\tmp\missing.txt -f
README.txt
current.txt
draft.txt
new.txt
Delete a directory recursively
del \sandbox\tmp -r
config/
data/
workspace/
Delete a directory recursively
del . -r
Protected path cannot be deleted
Delete a directory recursively
@md \sandbox\tmp\demo-folder | @mf \sandbox\tmp\demo-folder\temp.txt | del \sandbox\tmp\demo-folder -a
demo-folder/
  temp.txt

README.txt
current.txt
draft.txt
new.txt
Treat a path beginning with - as a filename
@mf \sandbox\tmp\-old.txt | cd \sandbox\tmp | del -- -old.txt
README.txt
current.txt
draft.txt
new.txt
-old.txt

README.txt
current.txt
draft.txt
new.txt

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 del. deletes files, symbolic links and directories