linux
successdd
这个作者很懒,什么都没留下…
展开
-
glob 模式简
【转】不同语言的 glob 库支持的规则会略有不同。下面是 node-glob 的匹配规则。* 匹配任意 0 或多个任意字符 ? 匹配任意一个字符 […] 若字符在中括号中,则匹配。若以 ! 或 ^ 开头,若字符不在中括号中,则匹配 !(pattern|pattern|pattern) 不满足括号中的所有模式则匹配 ?(pattern|pattern|pattern) 满足 0 或 1 括号转载 2018-01-15 16:33:56 · 220 阅读 · 0 评论 -
grep 全详解
使用的正则是 POSIX 格式的正则 不可以使用\d 只能使用[:digit:] 这样的缩写但是我也不建议使用[:digit:] 这样的形式 [0-9] 不是更直接 \w 使用 [a-zA-Z0-9]替代 反正根据自己的需求来 [\w 匹配字母或数字或下划线或汉字] 语法 grep [-abcdDEFGHhIiJLlmnOopqRSsUVvwxZ] [-A num] [-B num] [原创 2018-01-17 19:14:54 · 6913 阅读 · 0 评论 -
awk 使用
awk 和grep 的正则的区别在于 grep 的正则 是需要“/” 而 awk 不需要 “/” 进行包裹 awk 使用教程 awk - pattern-directed scanning and processing language (模式定位 扫描和处理语言) Awk scans each input file for lines that match原创 2018-01-17 17:02:03 · 523 阅读 · 0 评论 -
find 全解析
find 命令是linux 世界中查找文件用的最多的一个命令最简单的用法如下find dir -d(depth) 1 -type f(f 文件 d 文件夹) -ctime -1d-atime 最后的访问时间s secondm minute (60 seconds)h hour (60 minutes)d day (24 hours)w原创 2018-01-17 14:55:48 · 366 阅读 · 0 评论 -
12. sed 替换 增强版
原文 https://www.thegeekstuff.com/2009/09/unix-sed-tutorial-replace-text-inside-a-file-using-substitute-command/?utm_source=sitekickr&utm_medium=snip_button语法Syntax:#sed 'ADDRESSs/REGEXP/REPLACEMENT/FLA翻译 2018-01-17 12:02:39 · 777 阅读 · 0 评论 -
11. Sed 例子
去除代码中的注释dingmac@ubuntu:~$ echo -e "One\nTwo One\n#One\n//zhang" | sed -E 's@(//.*|#.*)@ ---- @' 打印出行数 类似wc -l seq 129 | sed -n '$='答应出前几行 head 10seq 120 | sed '10 q'打印出最后一行seq 102 | sed -n '$p'打原创 2018-01-17 10:26:24 · 149 阅读 · 0 评论 -
1.Sed 初识
Sed 指的是 Stream Editor SED can be used in many different ways, such as:Text substitution, 文字替换Selective printing of text files, 选择性答应text 文档In-a-place editing of text files, 编辑文档Non-interactive原创 2018-01-16 18:55:48 · 190 阅读 · 0 评论 -
4. Sed 行数控制
sed -n ‘1d’ files就是删除第一行‘2,5p’ 表示 prints all the lines from 2 to 5($) which represents the last line of the file‘2,+4 p’ books.txt 从第二行开始打印出后面4行‘M~n’ 50~5 matches line number 50, 55, 60, 6原创 2018-01-16 18:58:40 · 452 阅读 · 0 评论 -
5. Sed 模式
sed -n '/The/,$ p' books.txt从 The 开始到最后一行打印出来sed -n '/Two/, +4 p' books.txt #这个就不解释了 打印出后面的4行原创 2018-01-16 18:59:25 · 152 阅读 · 0 评论 -
2. Sed 语法初步
sed [-n] [-e] 'command(s)' files sed [-n] -f scriptfile files可以写在 文件中使用 sed -f scriptfile files 这样的格式调用在scriptfile中最后一个命令 写一行 类似于执行 sed -e 'commad1' -e 'commad2' files 或者 sed 'commad1;commad2' fi原创 2018-01-16 18:56:33 · 159 阅读 · 0 评论 -
6. Sed 基本操作符
d 删除w write 写入到文件a append 在某一行 跟随某一个[jerry]$ sed '4 a 7) Adultry, Paulo Coelho, 234' books.txt 得到的结果:1) A Storm of Swords, George R. R. Martin, 1216 2) The Two Towers, J. R. R. T原创 2018-01-16 18:59:52 · 857 阅读 · 0 评论 -
7.Sed 特殊操作符
=显示当前的行号[jerry]$ sed '=' books.txt On executing the above code, you get the following result:1 1) A Storm of Swords, George R. R. Martin, 1216 2 2) The Two Towers, J. R. R. Tolkien, 352原创 2018-01-16 19:01:22 · 244 阅读 · 0 评论 -
8.Sed 替换
s[jerry]$ sed 's/,/ | /' books.txt替换On executing the above code, you get the following result:1) A Storm of Swords | George R. R. Martin, 1216 2) The Two Towers | J. R. R. Tolkien, 352 3原创 2018-01-16 19:07:06 · 187 阅读 · 0 评论 -
9. Sed manage Pattern
参考 http://man.linuxde.net/sed - x - h - And curly braces {} are used to group multiple SED commands 下面的都是摘抄自 http://man.linuxde.net/sed 仅帮助回忆 具体查看man - a\ 在当前行下面插入文本。 有\ 表示将增加的内容 另起一行原创 2018-01-16 19:28:19 · 155 阅读 · 0 评论 -
3 .Sed Loop
LOOP 类似于goto we can define a label as follows::label :start :end :upIn the above example, a name after colon(:) implies the label name.:label的形式就是一个labelTo jump to a specific label, we原创 2018-01-16 18:57:40 · 379 阅读 · 0 评论 -
10. Sed正则表达式
^$.[][^][-] 区间\? -E 的时候不需要\\+ -E 的时候不需要 \*{n} 或者 {n,}| \ 转义字符\r\nPOSIX 类型的的正则[:alnum:][:alpha:][:blank:][:digit:][:lower:] … 我觉得用不到 我反正我是不怎么用 元字符 含义原创 2018-01-16 19:35:27 · 286 阅读 · 0 评论 -
centos 6.6 安装 imagemagick 和 php imagick 插件安装 心路历程
先介绍 环境Linux 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/LinuxCentOS release 6.8 (Final)aliyun 服务器整个的关系图:1. 第一遍安装 [安装部分只指出configure 参数]初始安装 从imaggick 官网下载 so...原创 2018-05-07 16:26:07 · 2292 阅读 · 0 评论