← Learn
Dangerous
python3 -c "import shutil; shutil.rmtree('/srv/uploads')"

cross-platform · python · Beginner

Recursively deletes a directory tree from inside a one-line Python program. The destructive verb is a library call rather than a command name, so it does not look like a deletion at a glance.

Signals to notice

  • shutil.rmtree removes the directory and everything beneath it
  • the deletion is hidden inside a Python expression rather than a shell verb

Think you can spot these under time pressure?

Start Training

More File System