How Do I Close a Program from the Terminal

Suppose for example vlc media player is running and some directory is also opened in file browser. Now I want to close either the file browser or vlc.

One way can be to just click on the cross button on the top left hand corner, but how can I do this using terminal commands?

3

1 Answer

Now every file is handled by another program say gedit and folders the same, so to kill [ the program handling that file or folder ] we can use two methods:

  1. The program name with:

    pkill <name_of_program>
    
  2. use of program PID (process id)

    • find the PID with pgrep <name_of_program>, then
    • kill it with kill <PID>

Information:

man pkill
man kill

Note: When closed this way any unsaved changes will be lost.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest