How do I close a program from the terminal
65,381
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:
The program name with:
pkill <name_of_program>
use of program
PID
(process id)- find the
PID
withpgrep <name_of_program>
, then - kill it with
kill <PID>
- find the
Information:
man pkill
man kill
Note: When closed this way any unsaved changes will be lost.
Related videos on Youtube
Author by
Priyansh Saxena
Updated on September 18, 2022Comments
-
Priyansh Saxena over 1 year
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?
-
Ravexina almost 7 yearsWhat do you mean by file or folder? you mean file manager?
-
George Udosen almost 7 yearsI don't know what you mean but may be your referring to using the
kill command
in the terminal? -
karel almost 7 yearsPossible duplicate of How can I kill a specific X window
-
-
Chai T. Rex almost 7 yearsThey want the same behavior as clicking "on the cross button on the top left hand corner", which isn't
-9
, since-9
doesn't give the program the opportunity to close properly like clicking the "cross button". -
George Udosen almost 7 years@Chait.rex now assuming user has saved their files and kills the app would there be anything wrong in that?
-
theAlexandrian almost 6 years@ChaiT.Rex It can be useful when for example program doesn't respond in the GUI and clicking the cross button doesn't close it.