NullVoider's picture
Add the Memory Archive corpus: 101 annotated GUI/terminal sessions
60a7ab2 verified
|
Raw
History Blame Contribute Delete
3.77 kB

Memory: explorer-delete-file-3

Overview

Delete a file from a shell. Use this as the terminal route to the same folder end state as the file-manager delete, with one important difference: the remove command deletes outright rather than moving the file to a recoverable area. The recorded trace opens a shell, removes report.pdf, and closes the shell with exit.

Prerequisites

  • A desktop environment with a file manager, or a shell.
  • A file that exists and can be identified at run time by name.
  • Write access to the folder holding it. Deletion changes the folder, not the file, so the folder's permissions are what govern.
  • Certainty that the file is the right one and is genuinely no longer wanted. Neither route asks for confirmation.
  • An understanding of which of the two end states is wanted. The file-manager route moves the file to a recoverable holding area; the shell route unlinks it immediately with nothing to restore from. The folder ends up in the same state either way, but only one of them is reversible.
  • A backup, if the contents matter. Nothing in this task creates one.

Steps

Step 1 — Left-click at (268, 1060)

The task is to delete a file outright, which is a single removal command, so the first move is to open a shell. Move the cursor and Left-click the PowerShell icon in the taskbar.

Step 1

Step 2 — Type: Remove-Item $env:USERPROFILE\corpus-seed\report.pdf

Type a Remove-Item command naming the file to delete. This differs from the Explorer route in a way worth knowing: Remove-Item deletes the file outright rather than sending it to the Recycle Bin, so there is nothing to restore afterwards. The end state matches the mouse trace — the file is gone from the folder — but the mechanism is not reversible.

Step 2

Step 3 — Press: Enter

After typing the command Press Enter to run the deletion. It reports nothing on success; the prompt simply returns, which is the shell's way of saying the file is gone.

Step 3

Step 4 — Type: exit

Type exit to close the shell.

Step 4

Step 5 — Press: Enter

After typing the exit Press Enter to run it and close the window.

Step 5

Notes & Edge Cases

  1. This is not the recycle bin. It removes the file straight away, with no holding area and nothing to restore from. The folder ends in the same state as the file-manager route, but the two are not interchangeable — where reversibility matters, move the file to a holding location instead.
  2. There is no confirmation. The command acts silently on exactly what it is given, which makes the accuracy of the path the entire safety mechanism.
  3. Read the path back before confirming. A wrong character produces an error; a wrong but valid path produces a successful deletion of the wrong file. Only one of those announces itself.
  4. Never widen the command to make it work. A recursive or forced option added because the plain command refused is the point at which a small mistake becomes a large one — if it refuses, find out why.
  5. Wildcards are expanded before the command sees them. By the time it runs, the pattern is already a list of real files, and the command cannot tell that more of them matched than were intended.
  6. The command succeeds quietly and reports nothing. Confirm from the folder rather than from the prompt returning.
  7. The environment variable in the path is expanded by the shell, so the same string handed to something that is not a shell leaves the literal text unresolved.