导航

上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页

2021年7月1日 #

输出控制

摘要: %f为float输入 %lf为double输入 输出时,%4.2f,整数位不足4个满足4位,小数点后保留两位 阅读全文

posted @ 2021-07-01 17:49 toughcactus 阅读(34) 评论(0) 推荐(0) 编辑

2021年6月30日 #

sort和uniq

摘要: 通常sort和uniq一起使用,sort在前,uniq在后。 uniq -c是把个数统计在一行的最前面;uniq -u是去重但不打印重复个数。 但uniq的去重是相邻且相同的缩为一个 # cat data1 1 2 2 2 2 3 3 1 1 1 # cat data1 |uniq -c 1 1 4 阅读全文

posted @ 2021-06-30 08:55 toughcactus 阅读(104) 评论(0) 推荐(0) 编辑

2021年6月29日 #

split命令

摘要: cat test_split 1 2 3 4 split -l 2 -d -a 4 test_split split_ #将test_split里的内容每两行分到一个文件,文件前缀split_ #使用后缀,后缀占4位,从0开始 ls split_0000 split_0001 阅读全文

posted @ 2021-06-29 16:40 toughcactus 阅读(42) 评论(0) 推荐(0) 编辑

2021年6月19日 #

重温数据库操作

摘要: update `表名` set `属性1`=`值` where `属性2`=`值` and `属性3`=`'字符串值'` 阅读全文

posted @ 2021-06-19 18:04 toughcactus 阅读(16) 评论(0) 推荐(0) 编辑

2021年6月17日 #

32位ipv4转字符串

摘要: 反正短时间内我这段代码查了2回,写了三回,而且我自己都有实现的 struct in_addr ad; char p[30] = "1.2.3.4"; char q[30]; ad.s_addr = inet_addr(p); snprintf(q, 30, "%s", inet_ntoa(ad)); 阅读全文

posted @ 2021-06-17 17:49 toughcactus 阅读(97) 评论(0) 推荐(0) 编辑

shell字符串拼接

摘要: #! /bin/bash TEST_PATH="/tmp/testFile" touch ${TEST_PATH}_bak /tmp目录下有文件testFile_bak 阅读全文

posted @ 2021-06-17 17:46 toughcactus 阅读(286) 评论(0) 推荐(0) 编辑

system函数

摘要: 今天因为日志大小限制的原因,需要使用system函数,但是system执行完shell命令后,产生SIGCHLD,我对该信号进行捕捉但没有相应pid记录,此时不能进行wait操作。 阅读全文

posted @ 2021-06-17 14:34 toughcactus 阅读(45) 评论(0) 推荐(0) 编辑

2021年6月15日 #

证书和许可

摘要: 之前学习加密的时候,有一个概念在非对称加密、数字签名之后,是证书,英文certificate。 最近在看软件许可证,也就是license授权,此时,license是许可的意思。 AES:对称加密的一种算法,加密和解密使用同一套密码。 RSA:非对称加密的一种算法,公钥公开,私钥私有。对信息加密后,只 阅读全文

posted @ 2021-06-15 17:30 toughcactus 阅读(610) 评论(0) 推荐(0) 编辑

openwrt查看命令

摘要: 查看UUID cat /proc/sys/kernel/random/uuid 查看RAM cat /proc/meminfo | grep MemTotal 查看CPU信息 cat /proc/cpuinfo 阅读全文

posted @ 2021-06-15 16:50 toughcactus 阅读(1217) 评论(0) 推荐(0) 编辑

2021年6月3日 #

setsid学习

摘要: 当前我写的程序在服务器上运行,没有设置后台运行,而且我也想看运行时打印到屏幕上的输出,而不是日志。 但是远程到服务器的连接断了之后,这种方式运行的程序也会退出。 Usage: setsid ./a.out 阅读全文

posted @ 2021-06-03 11:05 toughcactus 阅读(46) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页