從Ubuntu命令行按進程名稱殺死進程

There are a number of ways to kill a process if you know the name of the process. Here’s a couple different ways you can accomplish this. We are going to assume that the process we are trying to kill is named irssi

如果您知道進程的名稱,則有多種方法可以殺死該進程。 您可以通過以下兩種不同的方法來完成此操作。 我們將假設我們要殺死的進程名為irssi

kill $(pgrep irssi)

殺死$(pgrep irssi)

killall -v irssi

Killall -v irssi

pkill irssi

菲爾·伊爾西

kill `ps -ef | grep irssi | grep -v grep | awk ‘{print $2}’`

殺死`ps -ef | grep irssi | grep -v grep | awk'{print $ 2}'`

These techniques can be useful in shell scripts, where you wouldn’t know the process ID and would need to restart or kill a process.

這些技術在Shell腳本中非常有用,因為您不知道進程ID,因此需要重新啟動或終止進程。

翻譯自: https://www.howtogeek.com/howto/ubuntu/kill-a-process-by-process-name-from-ubuntu-command-line/

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278160.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278160.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278160.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

18 南京 D

裸的最小球覆蓋。 坐標范圍大一些所以我們把初始的溫度也設置的大一些。 1 #include <bits/stdc.h>2 using namespace std;3 typedef long long ll;4 typedef double db;5 const db INF 1e100;6 const db delta 0.98;7 const db eps 1e-8;8 struct p3{9 db x,y,z;…

如何在iPhone或iPad的控制中心中控制智能家居設備

Apple’s Home app offers quick controls for controlling smart lights, doorbells, thermostats, and other smart home devices—right in your iPhone or iPad’s Control Center. Here’s how to set it up and use it. Apple的Home應用程序可在iPhone或iPad的控制中心內…

亞信安全與安徽電信共創“云網融合”安全新局面

全面提升公共安全能力 聯合推“天翼U盾”保障移動政務安全 在近日舉辦的安徽“互聯網”產業合作峰會上&#xff0c;亞信安全宣布與中國電信安徽公司達成戰略合作&#xff0c;雙方將在“云網融合”的生態基礎上打造特色安全服務、促進政企協同安全監管、共創網絡安全平安城市等…

idea中開啟Run Dashboard

若沒有 下一步 ok 轉載于:https://www.cnblogs.com/aijiajia1314/p/10551007.html

電臺復活節_如何玩Android 11的隱藏復活節彩蛋游戲

電臺復活節Justin Duino賈斯汀杜伊諾(Justin Duino)Google includes a hidden “Easter Egg” with each new Android version. Android 11 has one of the more elaborate Easter Eggs as it’s actually a game you can play. We’ll show you how to find it and play. Goog…

AQS源碼閱讀筆記(一)

AQS源碼閱讀筆記 先看下這個類張非常重要的一個靜態內部類Node。如下&#xff1a; static final class Node {//表示當前節點以共享模式等待鎖static final Node SHARED new Node();//表示當前模式以獨占模式等待鎖static final Node EXCLUSIVE null;//表示當前線程等待鎖的動…

python之實現從ftp下載文件到本地

#!/usr/bin/python # codingutf-8 import os from ftplib import FTP # 引入ftp模塊class MyFtp:ftp FTP()def __init__(self,host,port21):self.ftp.connect(host,port)def login(self,username,pwd):self.ftp.set_debuglevel(2) # 打開調試級別2&#xff0c;顯示詳細信息s…

如何在Instagram上過濾冒犯性評論

Shubham AgarwalShubham AgarwalIf you have a public Instagram profile, chances are you’ve been a victim of inappropriate comments from strangers. Given the social network’s vast size, it’s practically impossible to escape such bad actors. Thankfully, Ins…

復雜性思維中文第二版 附錄 A、算法分析

附錄 A、算法分析 原文&#xff1a;Appendix A Analysis of algorithms 譯者&#xff1a;飛龍 協議&#xff1a;CC BY-NC-SA 4.0 自豪地采用谷歌翻譯 部分參考了《Think Python 2e 中譯本 第二十一章&#xff1a;算法分析》 算法分析 (Analysis of algorithms) 是計算機科學的一…

如何在Windows 8.1中獲取Windows 10樣式的開始菜單

On January 21, Microsoft officially announced the new features that would be included in Windows 10. While you’ll have to wait for the release to enjoy most of the new features, you can take advantage of the new Windows 10 Start menu today. 1月21日&#x…

Android工程中javax annotation Nullable找不到的替代方案

我們在某些Android開源庫中會遇到下面的引用找不到的問題&#xff1a;import javax.annotation.Nonnull;import javax.annotation.Nullable; 其實Android實現了javax的類似注解&#xff0c;可以使用下面的引用替換&#xff1a;import android.support.annotation.NonNull;impor…

HDU1561:The more, The Better——題解

http://acm.hdu.edu.cn/showproblem.php?pid1561 ACboy很喜歡玩一種戰略游戲&#xff0c;在一個地圖上&#xff0c;有N座城堡&#xff0c;每座城堡都有一定的寶物&#xff0c;在每次游戲中ACboy允許攻克M個城堡并獲得里面的寶物。但由于地理位置原因&#xff0c;有些城堡不能直…

ubuntu列出所有磁盤_列出Ubuntu上的磁盤空間使用情況

ubuntu列出所有磁盤Simply open a new Terminal window and type in this command 只需打開一個新的終端窗口并輸入此命令 df -Th f翻譯自: https://www.howtogeek.com/howto/ubuntu/list-disk-space-usage-on-ubuntu/ubuntu列出所有磁盤

python基礎之字符編碼

閱讀目錄 一 了解字符編碼的知識儲備二 字符編碼介紹三 字符編碼應用之文件編輯器3.1 文本編輯器之nodpad3.2 文本編輯器之pycharm3.3 文本編輯器之python解釋器3.4 總結四 字符編碼應用之python4.1 執行python程序的三個階段4.2 python2與python3字符串類型的區別一 了解字符編…

C# WinForm開發系列 - DataGridView

1.DataGridView實現課程表 testcontrol.rar 2.DataGridView二維表頭及單元格合并 DataGridView單元格合并和二維表頭.rar myMultiColHeaderDgv.rar 3.DataGridView單元格顯示GIF圖片 gifanimationindatagrid.rar 4.自定義顯示DataGridView列(行頭顯示行號與圖標,同一單元格顯示…

ruby語法_Ruby函數(方法)語法

ruby語法The Ruby language makes it easy to create functions. Ruby語言使創建函數變得容易。 Function Syntax 功能語法 def functionname(variable) return <value>end def functionname(variable)return <值>結束Examples 例子 Your function can compute …

011-git-將tag推送到遠端

1、將tag推送到遠端 在使用TortoiseGit過程中&#xff0c;push推送過程中&#xff0c;選擇include tag&#xff0c;遠端就有次分支。

pageadmin CMS網站建設教程:站點添加自定義字段

首先看看pagedmin默認的站點設置都有什么&#xff0c;如下圖&#xff1a; 這里只有一些最基本的參數設置&#xff0c;用過3.0版本或用過其他公司開發的cms的用戶應該有這種體驗&#xff0c;在站點設置中可以設置logo圖片&#xff0c;備案號&#xff0c;底部內容等等。 那么為什…

如何將世界時鐘和時區小部件添加到您的iPhone

When you work remotely or have friends and family who live in another country, it’s important to know what time it is across time zones. A world clock (or time zone) widget on your iPhone’s Home screen makes this much easier. 當您遠程工作或有家人和朋友居…

Python網絡爬蟲之三種數據解析方式

引入 回顧requests實現數據爬取的流程 指定url基于requests模塊發起請求獲取響應對象中的數據進行持久化存儲其實&#xff0c;在上述流程中還需要較為重要的一步&#xff0c;就是在持久化存儲之前需要進行指定數據解析。因為大多數情況下的需求&#xff0c;我們都會指定去使用聚…