4 ms·
This is probably the #1 problem with Unix-based systems in general for new users. There are so many ways to exit a command prompt depending on the application!
by alexpetralia 8y ago
This is probably the #1 problem with Unix-based systems in general for new users. There are so many ways to exit a command prompt depending on the application!
Off the top of my head: Ctrl+D, q, :q, exit, quit(), Ctrl+C, Ctrl+X.
Countless times have I been locked in an application and needed to cycle through those memorized commands to escape. Imagine doing that as a newbie.
- Aardwolf 8y agoctrl+d is the most dangerous kind! Since that one can also exit the terminal itself. gdb takes, depending on the situation, one time ctrl+d or two times ctrl+d to quit. It's a trap! So since gdb usually takes two times, muscle memory learns two times, but then in that rare instance where it required it only once... logged out of ssh :(
- bodyfour 8y agoIn bash: IGNOREEOF=10 In zsh: setopt ignore_eof In ksh: set +o ignoreeof In tcsh/csh: set ignoreeof Normally I just do this for login shells, so I can quickly exit out of subshells.
- vram22 8y agoSimilarly, to not overwrite an existing file when doing output redirection, there is bash's noclobber option. https://www.google.co.in/search?q=bash+set+noclobber https://www.google.co.in/search?q=bash+set+noclobber
- tasuki 8y ago10 ??? For bash I set `IGNOREEOF=1` so as to have to press ctrl+d twice to exit. Ten times seems a bit too many. How to do the same for zsh?
- pinouchon 8y agoYou forgot the most powerful of them all: Ctrl+Z followed by kill -9 pid
- beatgammit 8y agoOr, `kill %1` if you backgrounded it in the current shell (or whenever number `jobs` gives).