摘要: 添加单行 使用重定向操作符 >> 或 > echo "hello world" > test.txt # 重写 echo "hello world" >> test.txt # 追加 或者使用 tee echo "hello world" | tee -i test.txt # 重写 echo "h 阅读全文
posted @ 2022-12-07 17:12 clovershell 阅读(866) 评论(0) 推荐(0) 编辑
摘要: void fun1() { std::thread::id tid = std::this_thread::get_id(); printf("ID is %ld\n", *(long*)&tid); } void fun2() { std::thread::id tid = std::this_t 阅读全文
posted @ 2022-07-18 10:53 clovershell 阅读(2511) 评论(0) 推荐(0) 编辑
摘要: # pandoc changelog.md --latex-engine=xelatex --template=pandoc.template -o changelog.pdf ! Undefined control sequence. l.88 ...版本,***\*** 查了好多关于 “! Un 阅读全文
posted @ 2021-04-13 15:50 clovershell 阅读(583) 评论(0) 推荐(0) 编辑
摘要: 【转载】https://www.bilibili.com/read/cv5526128/ 一、安装中文版man 官方下载地址: https://code.google.com/archive/p/manpages-zh/ GITHUB项目地址: https://github.com/man-page 阅读全文
posted @ 2021-03-12 17:27 clovershell 阅读(1365) 评论(0) 推荐(0) 编辑
摘要: cmd or powershell: tree /? :命令提示; tree :不输入任何参数,输出一棵目录树,不显示文件,只显示目录; tree /F :递归显示目录结构;显示目录,也显示文件; 重定向到文本文件 tree /f > info.txt 阅读全文
posted @ 2021-03-05 11:08 clovershell 阅读(742) 评论(0) 推荐(0) 编辑
摘要: \cp -r file_new file_old 阅读全文
posted @ 2021-03-04 18:02 clovershell 阅读(316) 评论(0) 推荐(0) 编辑
摘要: #!/bin/sh if [ -z $1 ] || [ -z $2 ];then echo -e "usage: ./folder_save.sh [save num of int] [deal with path]" exit fi echo -e "0=$0,1=$1, 2=$2" basedi 阅读全文
posted @ 2020-11-30 17:51 clovershell 阅读(1361) 评论(0) 推荐(0) 编辑
摘要: #!/bin/sh ls -lrt| awk '{if(NR<4 && NR!=1) printf("rm -rf %s\n",$8)}' >rm2.sh chmod 755 rm2.sh ./rm2.sh rm rm2.sh 或 #!/bin/sh for i in `ls -lthr | hea 阅读全文
posted @ 2020-11-30 17:50 clovershell 阅读(970) 评论(0) 推荐(0) 编辑
摘要: 替换 语法为: :[addr]s/源字符串/目的字符串/[option] 全局替换命令为: :%s/源字符串/目的字符串/g [addr]表示检索范围,如: "1,n":表示从第1行到n行"%":表示整个文件,同"1,$"".,$":表示从当前行到文件尾 [addr]省略时表示当前行 s:表示替换操 阅读全文
posted @ 2020-11-30 17:46 clovershell 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 在shell脚本中使用awk命令, 如: filename=$1 cat $filename | awk -F"," '{$1="";print $0}' #删除输入的文档中逗号分隔的第一列,但awk中的$1会使用脚本的参数$1,这里是文档的名字,执行错误 解决方法: 脚本中awk用到自身的内置参数 阅读全文
posted @ 2020-11-30 17:37 clovershell 阅读(1313) 评论(0) 推荐(0) 编辑