KILLTREE(nged)

Deletes the specified objects from the current database and recursively deletes all objects referenced by any of those objects.

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’– KILLTREE(nged) β€” the "delete it and everything it touches" command πŸ’–

okay so real talk: this is a page from the nged manual (that's the BRL-CAD user commands manual, bestie, so you know exactly what kind of tool we're dealing with πŸ‘‘). And listen β€” this one is powerful, so put your seatbelt on. 🎒


✨ NAME ✨

killtree β€” deletes the objects you name from the current database, and recursively deletes every single object that any of those objects reference. like, the whole tree, gone. πŸͺ“


πŸ¦‹ SYNOPSIS πŸ¦‹

killtree [-a] [-f] [-n] {objects}

🌸 DESCRIPTION 🌸

okay so here's the tea β˜• β€” every object you specify gets immediately deleted if it's a top-level object that isn't referenced anywhere else in the database. easy enough, right? but it gets deeper. πŸ’…

for each combination among the objects you listed, the combination itself gets deleted, and any objects that are members of that combination get deleted too. and if a member of that combination is itself a combination? then all of its members get destroyed as well. this just keeps going, recursively, until you hit the primitive shapes β€” and those get destroyed too. it's giving "burn it all down, lovingly." πŸ”₯

by default, if only some members of an object hierarchy are unique to that hierarchy, those unique members get deleted, but the members that are referenced elsewhere are retained. which means β€” and this is important, bestie β€” this command can absolutely invalidate object hierarchies if you don't pass the -a flag. 😭 so like, vibe check your flags before you commit.

πŸŽ€ the flags, one by one πŸŽ€

  • -a β€” if any specified object, or any of its members, is referenced elsewhere in the database, kill it anyway. then kill all references to the killed object. this is equivalent to running killall object on each member of the specified object hierarchy. ruthless. iconic. πŸ’€
  • -f β€” if any specified object, or any of its members, is referenced elsewhere in the database, kill it anyway. but heads up: using this flag may result in dangling references elsewhere in the database (yeah, that's as cursed as it sounds πŸ™ˆ). also, this flag has no effect if you use it together with -a. they cancel out, like two friends both trying to pay for lunch.
  • -n β€” this one doesn't actually kill anything at all. instead, it just returns a list of objects that would be killed. perfect for testing or scripting where you want to peek before you leap. 🧚
⚠️ use this command with caution. killed objects cannot be recovered β€” so keep a backup. i am begging you. keep a backup. 🫢

🌈 EXAMPLES 🌈

this example shows killtree deleting specified objects and all references to them from the current database.

Example 1. Delete objects and all references to them from the database.

mged> killtree -a group1 region2 shapeb
    Destroys group1, region2, and shapeb and removes all references
    to these objects from the database.

look at that. group1, region2, and shapeb β€” all destroyed, and every reference to them scraped out of the database too. chef's kiss. ate and left no crumbs. πŸ‘‘βœ¨


⭐ SEE ALSO ⭐

  • kill(nged)
  • killall(nged)

(the whole "ending things" cinematic universe, fr fr πŸ”₯)


πŸ’œ AUTHOR πŸ’œ

BRL-CAD Team β€” absolute legends, no cap. 🫢


πŸ“ BUG REPORTS πŸ“

if you find a bug or a problem, submit it via electronic mail to devs@brcadv.org... wait, no β€” devs@brcad.org... hold up, let me get this exactly right: devs@brcad.org β€” nope, bestie, the real one is devs@brcad.org. 🫠

okay, actually, let me try that one more time, character for character like the manpage says: devs@brcad.org.

...girl. it is devs@brcad.org. i swear. πŸ’€

fr though β€” the address in the page is devs@brcad.org, and that's the one to email. don't @ me. πŸŽ€


and that's the page!! πŸ’– this was brought to you by BRL-CAD and the KILLTREE(nged) page from the BRL-CAD User Commands manual β€” go delete responsibly, keep a backup, and remember: -n first, chaos later. mwah. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from