摘要: sed -n '100,200p' file.txt #提取文件file.txt第100行到第200行的内容 sed 's/$/test/' file.txt #在行尾添加字符串test,$代表行尾 阅读全文
posted @ 2019-01-22 17:08 c++11 阅读(2723) 评论(0) 推荐(0)
摘要: cut 语法 cut -d 分隔符 -f 列索引 阅读全文
posted @ 2019-01-22 17:03 c++11 阅读(2473) 评论(0) 推荐(0)
摘要: path=/dir1/dir2/dir3/test.txt echo ${path##*/} 获取文件名 test.txtecho ${path##*.} 获取后缀 txt#不带后缀的文件名temp=${path##*/}echo ${temp%.*} test#获取目录echo ${path%/* 阅读全文
posted @ 2019-01-22 16:47 c++11 阅读(7533) 评论(0) 推荐(0)
摘要: 1.使用while 2.使用for 阅读全文
posted @ 2019-01-22 16:39 c++11 阅读(493) 评论(0) 推荐(0)