• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Dumb question: exit terminal commands

Pandamonium

Golden Member
So I've never figured this out but I probably should learn. The problem is that I don't know what to even google. So for the past few years, when I get myself in this pickle, I just restart a new terminal window...

So if I'm in terminal and I enter a command that I should have passed a parameter to, how to I "exit" it.

Ie: if I type "shasum" and then hit enter. Terminal kind of just lets me type and hit enter, etc. But it doesn't respond to anything I've tried. How do I get out of it?
 
It's going to depend on what the program in question is doing. For most interactive CLI programs, ctrl-c will break them and close them.
 
So I've never figured this out but I probably should learn. The problem is that I don't know what to even google. So for the past few years, when I get myself in this pickle, I just restart a new terminal window...

So if I'm in terminal and I enter a command that I should have passed a parameter to, how to I "exit" it.

Ie: if I type "shasum" and then hit enter. Terminal kind of just lets me type and hit enter, etc. But it doesn't respond to anything I've tried. How do I get out of it?

Either ctrl+c or ctrl+d, the former is cancel while the latter sends an End of File character so a tool like shasum which expects a file on stdin will detect the end and exit cleanly.
 
Yea, I thought it was either ctrl+x or ctrl+z to stop the process. But I haven't used Terminal in a while.
 
Thanks! Works wonders. Heh I feel like an out of place geezer.

I'm still fairly competent (for my needs) in DOS commands, which carried over nicely while I was running Windows exclusively. But I never figured out any flavor of *nix/BSD, so I've been winging it for the past 2 yrs or so while tinkering in Apple's BSD terminal. The fact that the computer stuff has become less of a hobby doesn't help either.
 
Yea, I thought it was either ctrl+x or ctrl+z to stop the process. But I haven't used Terminal in a while.

I believe Ctrl+Z sends SIGSTOP and puts the process into the background. How that works depends on the shell, but in bash you can then type 'bg' to put the process into the background and start it running again, type 'jobs' to list processes in the background and 'fg <number>' to bring a job back into the foreground.
 
Back
Top