exit 0 or \\ or simply control+d from a console.

Inside a function, the double backslash requires escaping. Use value “\\\\” or system “\\\\”

Note: kdb process exits can be trapped via .z.exit.