How to type '\' on command line?

On the course using command line, I couldn’t type ‘’.
I’m learning psql right now, so I have to type ‘’ on command line to quit psql. However, It didn’t work well.
I suppose this problem is regarding to the tool of DQ unique shortcut command with option key.

To avoid this problem, I typed ‘’ on a notebook outside of DQ and copied and pasted it from the notebook to command line on DQ. But this is not so smart for me.

If anyone has some good ways to solve this problem, could you give me some information, please?

Type \q and then press ENTER to quit psql . As of PostgreSQL 11, the keywords " quit " and " exit " in the PostgreSQL command - line interface have been included to help make it easier to leave the command - line tool. Ctrl + D is what I usually use to exit psql console.