What is the Difference Between Ctrl-Z and Ctrl-C in the Terminal?

Linux is a popular operating system that offers a command-line interface to control the system and execute commands. One of the essential skills a Linux user must have is knowing how to use keyboard shortcuts to simplify their work. Two of the most common keyboard shortcuts used in the terminal are Ctrl-Z and Ctrl-C.

This article will explore the difference between Ctrl-Z and Ctrl-C in the terminal along with their functionalities by following the below guideline.

What is the Function of Ctrl-Z?

Ctrl-Z is a keyboard shortcut used to suspend a process running in the foreground of the terminal. When a process is running in the terminal, it occupies the foreground, which means that it is currently active and being executed. By pressing Ctrl-Z, the process is suspended and put in the background, and you can resume it again later.

Example: Put the Command in the Background

For example, if you want to install LibreOffice, then you can run its installation command as shown below:

$ sudo apt install libreoffice

For any reason, if you want to suspend this process, then you need to press “Ctrl+Z” shortcut from the keyboard, and its impact can be seen on the output below:

Note: This command is super effective if you want to suspend any current running process for a while and want to start executing a new process as shown below: 

You can see in the above image that it temporarily stopped the installation of LibreOffice. 

How to Resume the Suspended Installation?

Later if you want to resume the execution of the suspended command, then you need to type “fg” command in the terminal. This command stands for “foreground,” which means that it will start executing the background process in the foreground as shown: 

$ fg

This command is useful if you are working on a long-running process in the terminal and you need to perform another task urgently. In that case, you can suspend the current process using Ctrl-Z and resume it later using the ‘fg’ command. 

What is the Function of Ctrl-C?

Ctrl-C is a keyboard shortcut used to abort a process running in the foreground of the terminal. When a process is running in the foreground, pressing Ctrl-C sends a signal to the process, causing it to terminate immediately. This is useful when a process is stuck or not responding, and you want to stop it forcefully.

Unlike Ctrl-Z, once the process is terminated, you cannot resume it or bring it back to the foreground. Therefore, you should use Ctrl-C with caution, as it can lead to data loss or other system failures, especially if you are updating the kernel or your system packages.

Example: Stop the Command’s Execution

As an example, the following output shows that by pressing CTRL+C, the execution of the command has been stopped, which can be seen as the “^C” shown at the end.

This command is useful when the users accidentally start a process that is consuming too many resources. In that case, you can terminate the process immediately using Ctrl-C. For example, let’s say you’re running a command that’s causing your system to freeze. You can use Ctrl-C to terminate the command forcefully.


Two of the most common shortcuts while utilizing the terminal that you should know are “Ctrl+Z” and “Ctrl+C.” The “Ctrl+Z” is used to suspend the process that can be resumed later, whereas Ctrl+C can only be used to terminate the process. This post has briefly demonstrated the purpose and working of the “CTRL+Z” and “CTRL+C”.