日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux 注销其它用户,linux下注销其它用户或者tty的命令

發布時間:2023/12/15 linux 48 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux 注销其它用户,linux下注销其它用户或者tty的命令 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

需求:

假設w輸出類似這樣

user1?? pts/0??? ...................... -bash

user1??? pts/1??? ...................... -bash

user2??? pts/2?? ...................... -bash

user2??? pts/3??? ...................... w

有沒有命令對指定的tty注銷用戶?又有沒有命令對指定的用戶注銷所有tty?

總感覺用ps kill -9 太暴力了點,也不方便......

其實可以通過skill命令來實現:

# skill

Usage:?? skill [signal to send] [options] process selection criteria

Example: skill -KILL -v pts/*

The default signal is TERM. Use -l or -L to list available signals.

Particularly useful signals include HUP, INT, KILL, STOP, CONT, and 0.

Alternate signals may be specified in three ways: -SIGKILL -KILL -9

General options:

-f? fast mode??????????? This is not currently useful.

-i? interactive use????? You will be asked to approve each action.

-v? verbose output?????? Display information about selected processes.

-w? warnings enabled???? This is not currently useful.

-n? no action??????????? This only displays the process ID.

Selection criteria can be: terminal, user, pid, command.

The options below may be used to ensure correct interpretation.

-t? The next argument is a terminal (tty or pty).

-u? The next argument is a username.

-p? The next argument is a process ID number.

-c? The next argument is a command name.

-t 這個參數可以多利用

總結

以上是生活随笔為你收集整理的linux 注销其它用户,linux下注销其它用户或者tty的命令的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。