
Shell
大胖头leo
这个作者很懒,什么都没留下…
展开
-
crontab命令
https://www.cnblogs.com/kenshinobiy/p/7685229.htmlhttps://blog.youkuaiyun.com/Trigl/article/details/62230233?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-.原创 2020-07-13 17:46:01 · 169 阅读 · 0 评论 -
Linux shell创建空文件(0字节大小)文件方法
https://blog.youkuaiyun.com/yexiangcsdn/article/details/81028359转载 2020-07-13 17:43:44 · 2024 阅读 · 0 评论 -
taskset指定进程执行CPU
转自:http://www.cnblogs.com/liuhao/archive/2012/06/21/2558069.htmlcoolshell最新的文章《性能调优攻略》在“多核CPU调优”章节,提到“我们不能任由操作系统负载均衡,因为我们自己更了解自己的程序,所以,我们可以手动地为其分配CPU核,而不会过多地占用CPU0,或是让我们关键进程和一堆别的进程挤在一起。”。在文章中提到了L...转载 2019-04-08 10:29:26 · 976 阅读 · 0 评论 -
Python multiprocessing进程pid
import multiprocessing as npimport timep = np.Process(target = time.sleep,args=(100,))p.start()pid = p.pidprint(pid)笔记, python affinity 库在python3 之后停止支持了,如果想要指定进程的CPU,需要使用shell 命令taskset...原创 2019-04-08 10:23:05 · 4351 阅读 · 1 评论 -
Python内执行Shell命令
方法1:import osmyCmd = 'ls -la'os.system(myCmd)这样就可以执行, 也可以通过pipe输出shell的结果import os myCmd = 'ls -la > out.txt'os.system(myCmd)方法二: 如果需要在python内返回结果import os myCmd = os.popen('ls -l...原创 2019-04-08 10:12:23 · 210 阅读 · 0 评论 -
Unix Shell编程——将多空格替换成单空格
1.只包含空格情况代码sed 's/ */ /g'1结果 2.包含多种空白符代码sed -e 's/[[:space:]][[:space:]]*/ /g'1结果转载 2018-10-05 17:32:44 · 3065 阅读 · 0 评论 -
统计grep查找的字符 一共有多少个匹配
grep -o "aaa" file | wc -l grep -o -o, --only-matching Prints only the matching part of the lines.原创 2018-10-05 17:31:01 · 9843 阅读 · 0 评论 -
Unix grep 返回第一次匹配的行
grep -m -m num, --max-count=num Stop reading the file after num matches.原创 2018-10-05 17:28:30 · 18595 阅读 · 0 评论 -
linux之cut命令的用法_unix linux
1)其语法格式为:cut [-bn] [file] 或 cut [-c] [file] 或 cut [-df] [file]使用说明cut 命令从文件的每一行剪切字节、字符和字段并将这些字节、字符和字段写至标准输出。如果不指定 File 参数,cut 命令将读取标准输入。必须指定 -b、-c 或 -f 标志之一。主要参数-b :以字节为单位进行分割。这些字节位置将忽略多字节字...转载 2018-10-05 17:26:17 · 1622 阅读 · 0 评论 -
uniq命令的用法
-u 只显示不重复行。-d 只显示有重复数据行,每种重复行只显示其中一行-c 打印每一重复行出现次数。-f n为数字,前n个域被忽略。一些系统不识别- f选项,这时替代使用- n。...原创 2018-10-05 17:24:52 · 439 阅读 · 0 评论