存档

文章标签 ‘Shell’

linux查看占用内存/cpu最高的进程情况

2014年4月8日 1 条评论

linux查看占用cpu最高的进程

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head

或者top (然后按下M,注意这里是大写)

linux查看占用内存最高的进程

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head
分类: Linux 标签: ,

nc: invalid option — ‘e’

2014年2月13日 1 条评论

nc反弹shell的时候出现错误
nc: invalid option — ‘e’
This is nc from the netcat-openbsd package. An alternative nc is available
in the netcat-traditional pac[……]

Read more

分类: Linux 标签: ,

Linux Shell脚本实现动态修改密码

2013年5月9日 没有评论

密码规则
固定字符串 + 年月日(转成键盘数字对应的符号) + 固定字符串

#!/bin/bash
#===================================`
# 动态修改密码                        #
# author :Qiufeng[......]<p class="read-more"><a href="https://www.fengdingbo.com/shell-update-passwd.html">Read more</a></p>
分类: Linux 标签: ,

shell脚本实现ssh自动登陆

2013年4月2日 没有评论

必要软件包:expect
ssh连接远程主机时候会询问密码,跟su、sudo命令的默认行为一样,是不从stdin读入数据的,传说是为安全考虑,但是有时候在脚本当中确实需要无人守值的登陆。
搜索一下不难找到类似的例子,使用expect来完成密码应答:

#!/bin/bash
auto_lo[......]<p class="read-more"><a href="https://www.fengdingbo.com/shell-auto-login-ssh.html">Read more</a></p>
分类: Linux 标签: ,

Linux Shell脚本实现根据进程名杀死进程

2013年1月23日 2 条评论

怀念windows下的任务管理器啊,有啥看的顺眼的程序鼠标点几下就能将其干掉。

今天在用Firefox浏览器浏览网页时,界面瞬间卡住了,什么都不能点,测试了下,只有切换到命令行界面(Ctrl+Alt+F1)才有反应,切回文本界面Ctrl+Alt+F7)后还是卡住的。ps:其他按键的感觉就像是失效一般,很无助的说。。。

游走在命令行界面发呆,正打算强制关机时,突然发现以前写的一个Shell脚本,功能是给出一个进程名,就会把关联进程Id全部kill掉。
Shell脚本根据进程名杀死进程[……]

Read more

分类: Linux 标签: ,