欢迎光临散文网 会员登陆 & 注册

Linux常用命令: 系统进程管理

2023-03-07 09:04 作者:石城城  | 我要投稿

放心~被指到的人一定能学会的~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

其他命令使用场景分类: https://www.bilibili.com/read/cv22241446


ps

显示执行进程信息

lsof

列表显示进程打开的文件信息

显示其他用户的打开文件时需要root权限

kill

给进程发送信号的命令,一般用来终止进程

 

 

1. ps

Information about running processes.

显示执行进程信息

• List all running processes(显示所有的执行进程信息):

• List all running processes including the full command string(显示所有的执行进程信息,包括完整的命令名):

• Search for a process that matches a string(从所有进程信息中搜索内容):

2. lsof

Lists open files and the corresponding processes.

列表显示进程打开的文件信息

Note: Root privileges (or sudo) is required to list files opened by others.

显示其他用户的打开文件时需要root权限

• Find the processes that have a given file open(找到占用文件的进程):

• Find the process that opened a local internet port(找到占用端口的进程):

• List files opened by the given command or process(显示指定命令或进程占用的文件):

 

3. kill

Sends a signal to a process, usually related to stopping the process.

给进程发送信号的命令,一般用来终止进程

• Terminate a program using the default SIGTERM (terminate) signal(通过终止信号结束进程):

• List available signal names (to be used without the SIG prefix)(显示所有可用信号,用的时候不用写SIG前缀或者使用信号代号):

kill -l

• Terminate a background job(终止后台任务):

• Signal the operating system to immediately terminate a program (which gets no chance to capture the signal)(立即终止进程):

 

自学笔记~

如果有错~

期待大佬指出~

感谢帮助提升~ 


Linux常用命令: 系统进程管理的评论 (共 条)

分享到微博请遵守国家法律