摘要: https://stackoverflow.com/questions/91110/how-to-match-a-single-quote-in-sed 今天在看一个例子 sed '/Larry\'s' Larry。 结果死活匹配不到。查询了google才知道。匹配单引号不能简单用转义符号\ 最简单 阅读全文
posted @ 2017-07-27 22:54 uxiuxi 阅读(283) 评论(0) 推荐(0)
摘要: 想要安装一个dhcp服务器。但是客户的环境不让用yum源安装。那就用源文件安装吧。参考文档https://www.crazycen.com/linux/514.html 1.tar zxvf dhcp-4.3.1.tar.gz 2.cd dhcp-4.3.1 3. ./configure && ma 阅读全文
posted @ 2017-07-27 09:29 uxiuxi 阅读(876) 评论(0) 推荐(0)
摘要: https://stackoverflow.com/questions/16414410/delete-empty-lines-using-sed 教科书上写的是d '/^$/d' tab.txt 。测试并不能删除由空格形成的。 要删除全部行包括 “ ”输入的空行 应该用 sed '/^\s*$/d 阅读全文
posted @ 2017-07-22 11:17 uxiuxi 阅读(440) 评论(0) 推荐(0)
摘要: 这个代码有三个地方不理解,现在终于理解了 1.for x 当时不了解这种结构,后面google,找到一个文档。http://www.thegeekstuff.com/2011/07/bash-for-loop-examples/?utm_source=feedburner。 就是for 不接 in的 阅读全文
posted @ 2017-07-20 00:22 uxiuxi 阅读(379) 评论(0) 推荐(0)
摘要: 今天同行遇到一个牛人,拥有RHCE、RHCA 、VCP、MSCE 、CCNA证书,很佩服他。今年我必须要拿一个RHCE+VCP之类的吧。目标 阅读全文
posted @ 2017-07-17 23:12 uxiuxi 阅读(118) 评论(0) 推荐(0)
摘要: echo "aGsdff:bDEf" >>employees root@ubuntu:/home/koyaku# sed 's/\([^,]*\):\([^,]*\)/\U\1\L\2/' employees Jones,Bob,232-78-3456Jackeson,Jane,,Federer,J 阅读全文
posted @ 2017-07-16 00:40 uxiuxi 阅读(306) 评论(0) 推荐(0)
摘要: 本地机器IP 172.16.20.222 对远端服务器172.16.200.170进行sed 操作。不好的地方是sed文件和 被修改文件必须要在同一台机器上 ssh -t root@172.16.200.170 sed -i.bbb -f /root/jin.sed /root/tmp.txt [r 阅读全文
posted @ 2017-07-15 10:44 uxiuxi 阅读(3118) 评论(0) 推荐(0)
摘要: 之前编辑文件都是用vim 命令,最近看视频学到一个用cat > 进行交互输入,感觉这样更方便 root@ubuntu:/home/koyaku# script create_file_use_cat.txtScript started, file is create_file_use_cat.txt 阅读全文
posted @ 2017-07-15 09:35 uxiuxi 阅读(805) 评论(0) 推荐(0)
摘要: Unlike ssh, scp uses the uppercase P switch to set the port instead of the lowercase p: The lowercase p switch is used with scp for the preservation o 阅读全文
posted @ 2017-07-14 22:57 uxiuxi 阅读(7500) 评论(0) 推荐(0)
摘要: 使用说明 首先备份/etc/yum.repos.d/CentOS-Base.repo 下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份) CentOS7 CentOS6 CentOS5 运行以下命令生成缓存 阅读全文
posted @ 2017-07-12 17:55 uxiuxi 阅读(151) 评论(0) 推荐(0)