2013年12月18日
摘要: 1) 到http://mirrors.163.com的 centos帮助文档 中下载CentOS6-Base-163.repo文件,存放到/etc/yum.repo.d中 wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 注意yum只... 阅读全文
posted @ 2013-12-18 23:09 lpthread 阅读(478) 评论(0) 推荐(0) 编辑
摘要: 在java code中获取本机IP的程序如下:import java.net.InetAddress;public class Test{ public static void main(String[] paramArrayOfString) throws Exception { InetAddress localInetAddress = InetAddress.getLocalHost(); System.out.println(localInetAddress.getHostAddress()); }}如果/etc/hosts 配置了127.0.0.1 上述c... 阅读全文
posted @ 2013-12-18 17:45 lpthread 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 如何用sed直接操作文件并备份# cat a.txtonetwothree# sed -i.bak '/two/d' a.txt // .bak is the suffix of backup file.# lsa.txt a.txt.bak# cat a.txtonethree# cat a.txt.bak onetwothree如果-i后没有指定suffix, 则不备份文件 阅读全文
posted @ 2013-12-18 09:24 lpthread 阅读(171) 评论(0) 推荐(0) 编辑