Control + W shortcut not working in Finder and Terminal
ControlW is an assigned shortcut in Bash. Notice, I said, Bash and not "Terminal" - basically it's present across all systems from Linux, BSD, macOS and Unix.

ControlW is "delete word."  It's similar to the  ⌫ Delete (aka Backspace) except it deletes an entire word.  

For more info on keyboard shortcuts see:  https://ss64.com/bash/syntax-keyboard.html