How to kill all running applications using terminal command.
we usually kill by command top and got the code of the application.

Dani AI

Generated

Brief clarification and caution: "Kill all applications" can mean different things — stop every instance of one program, terminate all processes for a user, or forcibly drop every GUI/login session. Each has different risks. Do not attempt to kill system-critical processes (PID 1 or kernel threads) and prefer graceful termination first so programs can clean up files and sockets.

As advised, always identify targets before acting. A concise, modern workflow is:

  • list matches by name,
  • send a graceful terminate signal,
  • only escalate to a hard kill if the process ignores the graceful signal,
  • if a process is managed by a service manager, stop the service rather than repeatedly killing the process.

Example commands (new alternatives to the ones above):

# list processes matching a name
pgrep -a firefox

# graceful stop for every exact match
pgrep -x firefox | xargs -r -n1 kill -s TERM

# escalate only if they ignore TERM
pgrep -x firefox | xargs -r -n1 kill -s KILL

To handle whole user sessions on systemd systems (safer than killing individual PIDs), use the session manager:

# end every process for a user (requires root)
loginctl terminate-user alice

If processes keep coming back because a service is supervising them, stop the service so it does not respawn:

systemctl stop nginx.service
systemctl disable --now nginx.service   # stop and disable

If you need to free a port before restarting a service, find the owning PID with a socket-listing tool:

ss -ltnp | grep :8080

Notes tied to earlier replies: 's idea to drop GUI sessions is valid — on modern systems prefer systemd-managed actions rather than legacy init scripts. 's pid lookup idea is useful; pgrep and ss are cleaner for scripting. Always double-check targets before sending destructive signals.

Recommended Answers

All 5 Replies

ps aux - to show list of running processes
ps aux | grep jetty - get list of all processes containing jetty and colour highlight them
kill 12345 - terminate/kill process with given ID

For Redhat Linux Insert CDROM is mounted in /mnt/cdrom,

rpm --import /mnt/cdrom/RPM-GPG-KEY
rpm -qa gpg-pubkey*
gpg-pubkey-db42a60e-37ea5438
rpm -qi gpg-pubkey-db42a60e-37ea5438
rpm -K /tmp/updates/*.rpm

Then type the following as root into a shell prompt:

ps -aux | grep imap

kill -9 <PID>

killall imapd

Hello,

Follow peter_budo not searchec. searchec having you regenerate the GPG key makes no sense however the ps aux is correct and killall is good for killing a specific application (example: killall html ).

If you want to log everyone out and kill all their apps ( I am a teacher. I have delusions of omnipotence... ;-) ), use /etc/init.d/gdm restart or stop.

That stops all the login sessions to the GUI which accomplishes a lot. I sometimes set that up in a crontab to dismiss class at a certain time... You can also use pkill -u someuser or pkill -f somecommand (watch out. That kills fred's somecommand and Bill's somecommand but it allows to kill all instances of something like a web browser.)

If you want to kill an application for example firefox:
# pidof firefox
# kill <pid>
or by simply typing
# killall firefox

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.