摘要: paste从英文来看是 粘贴 的意思,实际该指令确实有 粘贴 含义 列并排黏贴 paste 选项 file 常见选项包括 -s -d -s 或--serial 指串行 -d或--delimiters 分隔符 paste可以使用 重定向符 > 、>> 将内容定向至文件中 参考:https://www. 阅读全文
posted @ 2020-09-27 13:58 helloweifa 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.jianshu.com/p/a3aa6b01b2e1 linux lsof/netstat查看进程和端口号相关命令:https://www.cnblogs.com/zjdxr-up/p/8408885.html lsof命令查看端口占用 https://www.cnbl 阅读全文
posted @ 2020-09-27 10:52 helloweifa 阅读(519) 评论(0) 推荐(0) 编辑
摘要: sort的作用是排序,sort默认是将文件中的 每一行 按照字符 升序方式来排序的,当然可以设定为-n 即按照数字来排序 常用选项: -r 降序排序 -n 数字排序 -t 默认使用空格 来分割,注意下面的例子,如何用其他的特殊的分割符 来切割行 -k 域分割 这里是精华,需要重点注意 -u 指定是u 阅读全文
posted @ 2020-09-25 23:59 helloweifa 阅读(1048) 评论(0) 推荐(0) 编辑
摘要: # 总核数 = 物理CPU个数 X 每颗物理CPU的核数 # 总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数 # 查看物理CPU个数cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l # 查看每个物理CPU中c 阅读全文
posted @ 2020-09-25 23:57 helloweifa 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 更正一下:下面的压缩 都是 打包,不是压缩 1、在A机压缩后,复制到B机器并解压缩 原始数据->tar包->ssh远程tar解包还原,即所谓远程tar复制 文件到文件 tar -cf - /opt/dir1 | ssh 192.168.0.116 "cd /opt; tar -xf -" tar c 阅读全文
posted @ 2020-09-25 22:39 helloweifa 阅读(1085) 评论(0) 推荐(0) 编辑
摘要: 一、注意看以下的命令的不同点 二、python方式 #!/bin/bash #restart scrape news process if the process exited accidentally log_file="restart_sh.log" # return the current d 阅读全文
posted @ 2020-09-25 21:45 helloweifa 阅读(659) 评论(0) 推荐(0) 编辑
摘要: 变量说明$$ Shell本身的PID(ProcessID)$! Shell最后运行的后台Process的PID$? 最后运行的命令的结束代码(返回值)$- 使用Set命令设定的Flag一览$* 所有参数列表。如"$*"用「"」括起来的情况、以"$1 $2 … $n"的形式输出所有参数。$@ 所有参数 阅读全文
posted @ 2020-09-25 21:26 helloweifa 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 一、相关参数 https://rsync.samba.org/documentation.html 官网 https://download.samba.org/pub/rsync/rsync.1 具体使用 rsync竟然是samba团队开发的。 注意rsync默认同步 大小和修改时间有变动的文件,可 阅读全文
posted @ 2020-09-25 18:23 helloweifa 阅读(346) 评论(0) 推荐(0) 编辑
摘要: 常规的过滤方法为: ps aux | grep -v ‘grep’| grep xx | awk '{print $2}‘ 以上可以使用代替方法: pgrep nginx pgrep -f ’xxx.tar‘ pgrep 相关选项 参数如下:参考:https://man.linuxde.net 选项 阅读全文
posted @ 2020-09-25 16:03 helloweifa 阅读(369) 评论(0) 推荐(0) 编辑
摘要: 一、kill根据进程id杀进程,一般配合ps aux |grep -v ‘grep’ | grep xx| awk ‘{print $2}’过滤出pid 来杀单进程。 kill -1 6234或者kill -l 二、pkill 可以用来踢掉登录的用户 w如下: pkill -u root pkill 阅读全文
posted @ 2020-09-25 15:55 helloweifa 阅读(184) 评论(0) 推荐(0) 编辑