Did your Atom text editor become unresponsive and refuse to close or reboot?

On Ubuntu, you can force quit the Atom application by using the pkill command in your terminal.

Execute this command in your terminal to kill all processes running Atom on your machine:

    
      sudo pkill -9 atom
    
  

This command runs the pkill command with the -9 option, which is a SIGTERM signal used to tell a process how to terminate.

After successfully running that command, all the instances of Atom running on your machine should now be closed and terminated.

If you don't want to kill all the Atom processes running on your machine, you can also kill individual processes. To do this, you need to first list out all the PIDs (Process Identifiers) running Atom and then use the sudo kill -9 PID command to kill that specific process.

You can list all the processes running Atom with this command:

    
      ps aux | grep atom
    
  

The command uses ps aux to get all the processes running on your machine and then grep atom to filter out everything but processes running Atom.

This will output something that looks like the following:

    
      nick      1393  0.0  1.6 3777440 269664 pts/19 Sl   Jun25   2:21 /opt/atom/atom  ...
    
  

The first number you see in the output after the username (1393 in the example output above) is the PID for that specific process.

You can also modify the output to only show the PID numbers:

    
      ps aux | grep atom | awk '{ print $2 }'
    
  

This output will look like this:

    
      1393
      1467
      2513
    
  

Now that you have the PID/s for the process running Atom, you can end it with this command:

    
      sudo pkill -9 PID
    
  

That will kill only the specific PID number you give to the command.

Thanks for reading and happy coding!