greenZ

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  Linux

shell,expect,linux命令
摘要:【demo】sed替换指定行的整行和替换指定行中的部分字符串 1.创建文本文件 test.txt touch test.txt 输入以下内容: --What's wrong? What's wrong? favorite.food=Orange export favorite.food=Hambur 阅读全文
posted @ 2020-01-04 10:47 绿Z

摘要:【shell】整数运算,小数运算 1.整数运算 【demo01】expr typeset x=10 typeset y=2 n1=`expr $x + $y` n2=`expr $x - $y` n3=`expr $x \* $y` #使用expr时 符号* 需要转义 n4=`expr $x / $ 阅读全文
posted @ 2019-03-13 17:02 绿Z

摘要:设置时钟 date MMddhhmmyyyy.ss 例如,date 102110482013.00 #Mon Oct 21 10:48:00 wet 2013 同步到硬件时钟 hwclock -w 查看系统时间 date date -u 阅读全文
posted @ 2019-03-04 17:30 绿Z

摘要:修改主机名 vi /etc/hosts /etc/rc.d/boot.localnet restart /etc/init.d/network restart /etc/init.d/ncsd restart vi /etc/HOSTNAME 设置网卡地址 ifconfig ifconfig -a 阅读全文
posted @ 2019-03-04 17:29 绿Z

摘要:【修改ssh认证文件路径】 /etc/ssh/sshd_config 修改AuthorizedKeysFile ./ssh/authoried_keys 为 AuthorizedKeysFile /etc/ssh/auth_key/%u/authoried_keys 重启sshd /etc/init 阅读全文
posted @ 2019-03-04 17:27 绿Z

摘要:demo :expect与send 例子:在 node1上 执行test.sh 来调用node2上的 get_java_home.sh 1.在node1节点上 创建 test.sh vi test.sh 添加以下内容: #!/bin/bash passW="AaBbCc" /usr/bin/expe 阅读全文
posted @ 2019-01-09 11:17 绿Z

摘要:shell编程——EOF http://blog.163.com/njut_wangjian/blog/static/1657964252013112152418345 阅读全文
posted @ 2018-04-05 12:57 绿Z

摘要:查看linux命令的帮助文档:grep --helpgrep -v grep #在返回结果中过滤掉包含 grep 字符串的行 ps --helpps -fu <OS用户名> su --helpsu - oracle -c 'echo $ORACLE_HOME' #该su命令并不会切换用户,但是会得到 阅读全文
posted @ 2018-04-05 12:57 绿Z

摘要:linux中shell变量$#,$0,$1,$2的含义解释(转载) http://blog.chinaunix.net/uid-25100840-id-271097.html 阅读全文
posted @ 2018-04-05 12:55 绿Z

摘要:#根据 `pwd` 找到 PIDps -ef|grep `pwd`|grep -v grep|awk '{print $2}'ps -ef|grep `pwd`|grep -v grep|awk '{print $2}'|xargs kill -9 #根据 port 找到 PIDlsof -i:<p 阅读全文
posted @ 2018-04-05 12:49 绿Z

摘要:删除linux系统记录的历史命令 1.查看历史操作history2 删除历史操作history -c3.修改为不记录操作vim /etc/profile修改 HISTSIZE=0 (默认 HISTSIZE = 1000,表示记录最近的1000条命令),并reboot,则用户将不记录操作命令。 阅读全文
posted @ 2018-04-05 12:44 绿Z

摘要:使用场景:执行.bat提示 ant未安装;执行.bat提示 缺少maven下的jar包 1.安装 ant 1)配置 环境变量 2)查看 ant版本 2.安装 maven 1)配置 环境变量 2)查看 maven版本 阅读全文
posted @ 2017-06-14 17:35 绿Z