10

如何在 Ubuntu 云服务器运行 sh 脚本的时候退出到可以输入命令的模式

 4 years ago
source link: https://www.v2ex.com/t/779374
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Linux

如何在 Ubuntu 云服务器运行 sh 脚本的时候退出到可以输入命令的模式

  TwoSetViolin · 1 天前 · 704 次点击

本人 Linux 小白 执行一个自动化部署脚本的时候,发现 mysql 下载服务只有几 Kb 每秒, 想要强制暂停该脚本,把 mysql 的安装包下载后再自己上传上去, 我已经找到强制暂停的命令, 但是不知道怎么从脚本正在运行的情况下跳到可以有光标输入的情况

这是找到强制停止脚本的命令:

  • ps -ef/ps -aux: 这两个命令都是查看当前系统正在运行进程,两者的区别是展示格式不同。如果想要查看特定的进程可以使用这样的格式:ps aux|grep redis (查看包括 redis 字符串的进程),也可使用 pgrep redis -a 。

注意:如果直接用 ps (( Process Status ))命令,会显示所有进程的状态,通常结合 grep 命令查看某进程的状态。

  • kill -9 进程的 pid: 杀死进程(-9 表示强制终止。)

先用 ps 查找进程,然后用 kill 杀掉


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK