Skip to content
UniKit

File deletion command generator

Turn a list of file paths into ready-to-paste delete commands — rm on Linux/macOS, del (cmd) or Remove-Item -LiteralPath (PowerShell) on Windows — with paths containing spaces and quotes escaped correctly.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

File paths

One path per line; surrounding whitespace is trimmed and blank lines are ignored. The output is only text — nothing is deleted.

Commands

One command per line, with paths quoted and escaped for the selected shell.

Enter file paths to generate commands

Files: 0

What this tool does

  • Turn a backup manifest or build-artifact list into commands you can paste straight into a terminal
  • Get both cmd and PowerShell forms while rewriting a script on a Windows server
  • Handle file names with spaces, apostrophes or Chinese characters without hand-escaping quotes

Example

Input

a.txt
b c.txt

Output

rm 'a.txt'
rm 'b c.txt'

Default Linux without -f: paths are wrapped in POSIX single quotes so names with spaces are still safe.

Frequently asked questions

What does each system produce?

Linux and macOS both produce rm (macOS ships BSD rm whose command form matches Linux; paths use POSIX single quotes with an inner apostrophe escaped as '\''). Windows has two shells: cmd emits del "path" (del /F "path" when force is on) and PowerShell emits Remove-Item -LiteralPath 'path' (adding -Force when force is on, with inner apostrophes doubled).

What does the force option change?

Linux/macOS add -f (ignore missing files, never prompt), cmd adds /F (delete read-only files) and PowerShell adds -Force. Without it, read-only files or confirmation prompts can fail or block the script.

Which escapes are impossible?

cmd cannot escape a double quote inside a double-quoted argument and expands variables such as %VAR%, so switch to the PowerShell output when a name contains " or %. A PowerShell single-quoted string is literal and never expands variables, which is the safest option. File names containing newlines (legal on Linux) cannot be expressed one-per-line and are not supported.

Will the tool delete my files?

No. It only produces text; it never touches the disk, runs a command or uses the network. Always review the paths before pasting the commands into a terminal — deletion cannot be undone.

Keywords:Remove-Itemfile-delete-cmd

Related tools