Ubuntu Killall Command

29/12/2020
Every single Linux distros is a collection of standard and something other tools at the core. Ubuntu, being one of the most popular ones, offers the most popular and powerful Linux tools in the wild. “killall” is such a powerful tool at your disposal. Let’s find out what you can do with “killall”. It’s just like “kill” but with a lot more power in the pocket. It’s a CLI tool. Caution is a must as a wrong command can completely render your system useless.

Killall command

“killall” follows the following structure –

killall [OPTIONS] name

According to the man page of “killall”, the tool sends a signal to the target processes. Without specifying the signal type, the default is SIGTERM. If “killall” is able to kill at least 1 process matching the requirements, it returns a zero return code. You can’t kill a “killall” process.

Killing a process

This is the most basic usage of “killall” command. All you have to do is just pass the name of the process.

For example, I’ve got GNOME Disks open, process name “gnome-disks”. For killing the process, run the following command –

killall gnome-disks

Asking for permission

When you’re running “killall” commands, there’s a pretty good chance that you’re about to kill something unintended. You have to use the “-i” flag.

killall -i gnome-disks

Case sensitivity

Generally, “killall” is a case-sensitive tool, so make sure that you type the name correctly.

# Wrong command
killall GNOME-disks

# Correct command
killall gnome-disks

If you want to force killall as case-insensitive, use “-I” flag.

killall -I GNOME-disks

Choosing the ENDING signal

There are different types of termination signal available. If you want to use a specific end signal, use the following structure –

killall -s

# OR
killall –signal

# OR
killall -SIGNAL

For finding out the available signal list, use the “-l” flag.

killall -l

Killing process by the time

You can also tell “killall” to terminate the processes depending on their time of running!

killall -o [TIME]

# OR
killall –older-than [TIME]

For example,

killall -o 2h

This command will kill all the processes that have been running for more than 2 hours.

killall -y [TIME]

# OR
killall –younger-than [TIME]

For example,

killall -y 2h

This command will kill all the processes that are younger than 2 hours.

Killing all the processes owned by a user

This is a very risky thing to do and may even render your system useless unless you restart it. Make sure that you have all your important tasks finished.

The structure goes like this –

killall -u [USERNAME]

For example,

killall -u viktor

This command will kill everything under the user “viktor”.

Other “killall” commands

There are a number of other available commands of “killall”. For the short list, use the following command –

killall –help

For an in-depth explanation of every single parameter and options, the man page is the best option.

man killall

You can export the man page to a separate text file for reading later.

man killall > ~/Desktop/killall.txt

Enjoy!

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

To get Lyrics on Spotify Music – Install Lyricfier on Ubuntu

In this post, we will show you how to install lyricfier on Ubuntu to enable you get Lyrics on Spotify Music. Spotify once...
12/02/2020

Ubuntu Change Login Screen Background

Whenever you login into your computer, you’re presented with a screen asking your credential to verify that it’s you....
29/12/2020

LVM Ubuntu Tutorial

LVM or Logical Volume Manager makes management of disk space on a Linux machine easier to manage.  Features of LVM include: Create,...
28/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

SỰ KHÁC BIỆT GIỮA RESIDENTIAL PROXY VÀ PROXY DATACENTER
17/02/2024

Mua Proxy v6 US Private chạy PRE, Face, Insta, Gmail
07/01/2024

Mua shadowsocks và hướng dẫn sữ dụng trên window
05/01/2024

Tại sao Proxy Socks lại được ưa chuộng hơn Proxy HTTP?
04/01/2024

Mua thuê proxy v4 nuôi zalo chất lượng cao, kinh nghiệm tránh quét tài khoản zalo
02/01/2024