![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
arch
Peter_ch_26
热爱生活,热爱编程
展开
-
如何管理和快速登录多台服务器(基于expect)
背景 shell快速登录多个机器。 平时需要经常切换多个机器,或者需要通过跳板机来回换登录机器。 为了便于自己快速登录,和每次找机器,写了登录管理工具https://github.com/cgpeter96/shell/blob/main/login_remote.sh。 依赖 基于expect和shell编写,因此需要安装expect #rehat or centos yum install expect # debian apt install expect 脚本说明 每次有新机器的时候就复制下以下内原创 2022-04-27 19:43:48 · 373 阅读 · 0 评论 -
linux服务器防止误删操作(重命名rm)
复制内容到自己的.bashrc下 # Prevent accidental deletion # trash_home=/home/$USER/.trash/ alias rm=del #删除 alias rl='ls $trash_home' #陈列垃圾箱 alias ur=undelfile # 恢复删除文件 alias ct=cleantrash # 清空回收站 alias RM='/bin/rm' #这个路径需要根据不同机器确定 undelfile(){ mv -i $trash_hom原创 2021-12-30 18:23:04 · 765 阅读 · 0 评论