2020年9月2日
摘要: 代码: find -type f ! -name "*.jpg" ! -name "*.png" ! -name "*.jpeg" ! -name "*.php" ! -name "*.txt" ! -name "*.php5" ! -name "*.asp" 阅读全文
posted @ 2020-09-02 23:29 夏雨等秦天 阅读(367) 评论(0) 推荐(0) 编辑
摘要: grep常见命令参数 -n 打印行号 grep -n ".*" h.txt 所有打印行号 grep -n "root" h.txt 匹配的内容显示行号 -v 不包括 -E 表示过滤 多个参数 grep -Ev "sshd|network|crond|sysstat|" -o:仅打印你需要的东西,默认 阅读全文
posted @ 2020-09-02 22:48 夏雨等秦天 阅读(493) 评论(0) 推荐(0) 编辑
摘要: 方法1: grep -E "^$" 1.txt | wc -l 详解:在网上摘抄,个人觉得不使用-E参数也行,利用正则^$可帅选出空行 方法2: file="1.txt" sed -n '/^$/p' 1.txt |wc -l 详解:-n选项:只显示匹配处理的行(否则会输出所有) 方法3: awk 阅读全文
posted @ 2020-09-02 22:13 夏雨等秦天 阅读(562) 评论(0) 推荐(0) 编辑
  2018年3月6日
摘要: 图片:main方法中的c和show方法中的c不是同一个c,main方法中Car c = new Car();show(c);可以改成任意的Car b = new Car();show(b);可以把"c","b"当作是new出来的车或对象,在调用show方法"show(c)"时,是把main方法中的c 阅读全文
posted @ 2018-03-06 23:19 夏雨等秦天 阅读(1653) 评论(0) 推荐(0) 编辑
  2018年2月1日
摘要: 1 package day02; 2 3 public class SelectSort { 4 public static void selectSort(int[] arr){ 5 for(int x=0;x<arr.length-1;x++){ 6 for(int y=x+1;y<arr.le 阅读全文
posted @ 2018-02-01 17:24 夏雨等秦天 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1 package day02; 2 3 public class FunctionOverload { 4 public static void main(String[] args){ 5 int a = add(3,4); 6 int b = add(3,4,5); 7 //System.ou 阅读全文
posted @ 2018-02-01 12:06 夏雨等秦天 阅读(180) 评论(0) 推荐(0) 编辑
  2018年1月19日
摘要: 判断结构 if(条件){}; if(条件){} else{ }; if(条件){}else{};格式类似3目运算:int a=2,b;b=(a>5)?7:8;这种格式比较简便 if(条件){ } else if(条件){ } else{ }; 选择结构 switch(){ case 条件:执行语句; 阅读全文
posted @ 2018-01-19 16:57 夏雨等秦天 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 逻辑&(与) 只要两边的boolean结果有一个为false,结果为false; 只有两边都为true,结果才为true; 还有一种逻辑&&(短路与) &:无论左边为真还是为假,右边都会运算 &&:当左边为false,右边不会运算 逻辑|(或) 两边只要有一个为true,结果为true; 只有两边都 阅读全文
posted @ 2018-01-19 16:35 夏雨等秦天 阅读(125) 评论(0) 推荐(0) 编辑