配置iTerm2打开自动执行命令

打开iTerm2,commad+o,打开profies->edit profies,点击+号,创建一个新的profile


在新的profile中填写

name:随意

command:Login Shell

Send text at start:执行脚本的命令,不想写路径可以把脚本到/usr/local/bin里面(赋予执行权限也要相应修改),此处的脚本地址是在终端到脚本目录下用pwd命令获取的。

bash 复制代码
expect /Users/用户名/software/iTerm2/login.exp 端口 服务器用户名 服务器ip 密码

回到profiles页面,双击新建的profile即可自动连接到服务器。

打开iterm2,点击配置文件,点击timemachine_snapshot_cleanup,执行profile。

设置source ~/.bash_profile为打开iterm2时默认执行的命令。

相关推荐
未济3 天前
linux 配置环境变量
linux
傲世仙尊3 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
_艾伦 耶格尔.3 天前
进程间通信
linux
Liuqy-053 天前
Linux IO编程——静态库、动态库
linux
彧azz3 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅3 天前
linux(8) 软硬链接
linux·运维·服务器
AIgorithmGEEK3 天前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid
琥珀色糖3 天前
SimlpeHttp
linux·服务器
qeen873 天前
【Linux】操作系统之进程介绍(二)
linux·笔记·学习·进程
Zenova EdgeOS3 天前
Linux ss 工业边缘网络分析实战
linux·python·边缘计算·工业网关