DEV Community

Discussion on: Helpful Terminal Commands for Beginners!

Collapse
 
codemouse92 profile image
Jason C. McDonald

Great post!

Just FYI, Ctrl+z is more than just a stop - it's a pause (specifically SIGTSTP) for the currently running process; by contrast, Ctrl+c is an abort (specifically SIGINT), which ends and closes the process.

After typing Ctrl+z, you should generally decide where you want to run the process by typing either fg (to bring it back to the foreground and resume it) or bg (run it in the background); if you don't do either, then it'll just hang out in memory waiting for permission to continue.

You can see the complete list of jobs running on that shell by typing jobs; their status is listed there as well. To resume a job, typing %n where n is the process number in the jobs list.

Long story short, you don't want to confuse Ctrl+z and Ctrl+c: the latter aborts the process, but the former leaves it idling in memory.

Collapse
 
jeikabu profile image
jeikabu

Beat me to it. ctrl+z, bg, and fg were indispensable to me when I started.

Maybe less so now that everyone starts out in xwindows, but I still forget a trailing & every now and then.