polysh入门
2016-07-01 11:07
253 查看
polysh主页:连接地址
安装方法:
命令前面的
在命令前的
polysh帮助:连接远程主机后,输入
推出polysh:连接远程主机后
一下所有交互注意命令前面的符号:
将hostname shell添加到polysh批量处理的shell集合
将本地工作目录变更到原工作目录下的子文件夹testdir。
可以在测试前后使用
我的在使用
此处使用
例子2:
此处使用
例子3:
此处使用
之前使用
没有worker16的连接和状态信息了。
如果在disable后,执行purge,那么就不能使用enable回复之前的连接了。
改名后第一个为XXX,第二个为XXX#1,第10个为XXX#10。。。以此类推
例子2:
使用这种方式改名不知道怎么使用改变后的shell名来执行操作。。。求有知道的大神指教!
改名后,所有polysh交互命令均需要使用改名后的名字操作,例如想将原名字为worker16,现名为XXX的shell disable,必须使用现有名去操作。
例子:
例子:
调试输出:
例子:
安装
安装前提python版本>2.4安装方法:
pip install polysh
使用
说明
在使用polysh连接远程shell后,命令前面的
:表示,所有的命令都是在与polysh交互,并且命令不会发送到远程shell
在命令前的
!表示在本地shell中执行,不会发送到远程shell
常用方法
主机名登录:polysh 'hostname-preffix-<number01-nunmber05>'
polysh帮助:连接远程主机后,输入
:help
ready (15)> :help :add 添加远程连接Add one or many remote shells. :chdir 改变本地工作目录(不是远程目录)Change the current directory of polysh (not the remote shells). :disable 关闭发送命令到远程shell功能Disable sending commands to remote shells. :enable 启用发送命令到远程shell功能Enable sending commands to remote shells. :export_vars 在远程shell定义环境变量Export some environment variables on enabled remote shells. :help 帮助列表List control commands or show their documentations. :hide_password Do not echo the next typed line. :list 列出远程shell和对应的状态List remote shells and their states. :purge 删除失效远程shell Delete disabled remote shells. :quit 登出polysh Quit polysh. :reconnect 重新连接已断开连接的远程shell Try to reconnect to disconnected remote shells. :rename 重命名Rename all enabled remote shells with the argument. :replicate 复制文件Copy a path from one remote shell to all others :reset_prompt Change the prompt to be recognized by polysh. :send_ctrl Send a control character to remote shells. :set_debug Enable or disable debugging output for remote shells. :set_log 将命令窗口输出到指定本地文件Duplicate every console I/O into the given local file. :show_read_buffer Print the data read by remote shells. :upload Upload the specified local path to enabled remote shells.
推出polysh:连接远程主机后
:quit
polysh交互命令详解
说明:一下所有都是在已进入polysh一下所有交互注意命令前面的符号:
:表示与polysh交互;
!表示与本地shell交互
add
例子::add hostname
将hostname shell添加到polysh批量处理的shell集合
chdir
例子::chdir testdir
将本地工作目录变更到原工作目录下的子文件夹testdir。
可以在测试前后使用
!pwd查看本地工作目录,并对比。
我的在使用
:chdir前
!pwd输出
/opt/home/heguangfu/,
:chdir test后输出
/opt/home/heguangfu/test
disable和enable
例子1::disable使所有的连接不处于激活状态,发送命令不会发送到远程shell。polysh交互提示由
ready (15)>变为
ready (0)>。
此处使用
:enable重新启用所有远程连接。
例子2:
:disable hostname使指定远程shell失效。
此处使用
:enable hostname重新启用指定远程shell的连接。
例子3:
:enable worker16只启用worker16远程shell,其余的不启用。可实现对该shell单独操作。
此处使用
:enable重新启用所有远程连接。
list
例子::list列出所有连接和状态。
ready (14)> :list worker16 disabled idle: colors=/home/heguangfu/.dircolors worker17 enabled idle: colors=/home/heguangfu/.dircolors worker18 enabled idle: colors=/home/heguangfu/.dircolors worker19 enabled idle: colors=/home/heguangfu/.dircolors worker20 enabled idle: colors=/home/heguangfu/.dircolors
之前使用
:disable的远程shell状态为disable状态(worker16),其余为enable状态。
purge
例子:purge,删除出狱disable状态的远程shell。
worker17 enabled idle: colors=/home/heguangfu/.dircolors worker18 enabled idle: colors=/home/heguangfu/.dircolors worker19 enabled idle: colors=/home/heguangfu/.dircolors worker20 enabled idle: colors=/home/heguangfu/.dircolors
没有worker16的连接和状态信息了。
如果在disable后,执行purge,那么就不能使用enable回复之前的连接了。
rename
例子1::rename XXX将所有
:list可以查看到的远程shell改名为XXX(原来是个主机hostname)。
改名后第一个为XXX,第二个为XXX#1,第10个为XXX#10。。。以此类推
例子2:
:rename AAA XXX, 将所有shell改名为
AAA XXX+编号。
使用这种方式改名不知道怎么使用改变后的shell名来执行操作。。。求有知道的大神指教!
改名后,所有polysh交互命令均需要使用改名后的名字操作,例如想将原名字为worker16,现名为XXX的shell disable,必须使用现有名去操作。
replicate
例子::replicate worker16:filename。将worker16上的文件filename发送到所有其它enable的远程shell。
:replicate只能将文件从一个远程shell发送到其余远程shell。
set_log
将命令窗口输出到指定本地文件例子:
:set_log /tmp/log,将远程shell输出到本地指定文件中。
set_debug
开启和关闭远程shell的调试。例子:
:set_debug y,开启调试。
调试输出:
dx:aaa#11 : /home/xxx [dbg] dx:aaa#11[running]: state => idle [dbg] dx:aaa#12[running]: ==> /home/xxx\npolysh-4wBrH:prompt:YcWrA:13/\n
例子:
:set_debug n, 关闭调试。
相关文章推荐
- Polysh命令实现多日志查询的方法示例
- 构造函数析构函数为什么没有返回值?
- python-操作exel(xlrd,xlwt)
- 智能合约初体验
- C#动态调用WCF
- 《离散数学及其应用》读书笔记【三】计数
- maven安装jar包到本地库或私服
- 一分钟快速了解XMind7.5中的那些新功能
- C++类型转换----const_cast
- iOS-关于多线程
- C语言练习题每练 2:找出三个字符串中最大的
- 使用 RMI + ZooKeeper 实现远程调用框架
- php+MySql实现登录系统与输出浏览者信息功能
- 解决Eclipse再次打开工程时找不到Design设计模式的问题
- 获取图片大小
- Loadrunner分布式测试
- 浅谈敏捷开发中迭代和旧版本维护
- 启动安卓模拟器报错 emulator: ERROR: x86_64 emulation currently requires hardware acceleration! CPU acceleration status:HAXM must be updated(version 1.1.1<6.0.1) 解决办法
- Loadrunner分布式测试
- 时间处理