diff --git a/c/ab.html b/c/ab.html index 65b92409a3..4f872f31c0 100644 --- a/c/ab.html +++ b/c/ab.html @@ -10,7 +10,7 @@ ab 命令,Linux ab 命令详解:Apache服务器的性能测试工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -48,7 +48,8 @@ name:password ] [ -q ] [ -s ] [ -S ] [ -t timelimit ] [ -T content-type ] [ -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes ] [http://]host‐ -name[:port]/path +name[:port]/path +

选项

-A auth-username:password
       #  支持基本的验证证书,用户名和密码之间使用"冒号"                    :
       # 分隔开,ab将以明文方式传送过去.不管服务器是不是需要
@@ -138,7 +139,8 @@ name[:port# 用于生成html表格每行的属性名 (<tr>)
 
 -z <td>-attributes
-      # 用于生成html表格每列的属性名 (<td>)
+ # 用于生成html表格每列的属性名 (<td>) +

参数

主机:被测试主机。

@@ -164,7 +166,7 @@ name[:port - - + + \ No newline at end of file diff --git a/c/accept.html b/c/accept.html index 0a773e2b1c..7d7f0c565f 100644 --- a/c/accept.html +++ b/c/accept.html @@ -10,7 +10,7 @@ accept 命令,Linux accept 命令详解:指示打印系统接受发往指定目标打印机的打印任务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -42,10 +42,12 @@

accept

指示打印系统接受发往指定目标打印机的打印任务

补充说明

accept命令 属于CUPS套件,用于指示打印系统接受发往指定目标打印机的打印任务。

-

语法

accept(选项)(参数)
+

语法

accept(选项)(参数)
+

选项

-E:当连接到服务器时强制加密;
 -U:指定连接服务器时使用的用户名;
--h:指定连接服务器名和端口号。
+-h:指定连接服务器名和端口号。 +

参数

目标:指定目标打印机。

@@ -70,7 +72,7 @@ - - + + \ No newline at end of file diff --git a/c/ack.html b/c/ack.html index 907e6dd74c..d2f3bb96de 100644 --- a/c/ack.html +++ b/c/ack.html @@ -10,7 +10,7 @@ ack 命令,Linux ack 命令详解:比grep好用的文本搜索工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -44,10 +44,12 @@

安装

# ubuntu下要安装ack-grep,因为在debian系中,ack这个名字被其他的软件占用了。
 sudo apt-get install ack-grep
 # alpine Linux-apk软件包管理器 安装 ack
-apk install ack
+apk install ack +

参数

这些参数在linux上的适用频率是相当高的,尤其是你用vim做为IDE的话

-c(统计)/ -i(忽略大小)/ -h(不显示名称)/
--l(只显文件名)/ -n(加行号)/ -v(显示不匹配)
+-l(只显文件名)/ -n(加行号)/ -v(显示不匹配) +

特点

ack官网列出了这工具的5大卖点:

  1. 速度非常快,因为它只搜索有意义的东西。
  2. @@ -63,28 +65,34 @@ apk install ack

    grep常用操作

    grep -r 'hello_world' # 简单用法
     grep '^hello_world' . # 简单正则
    -ls -l | grep .py # 管道用法
    +ls -l | grep .py # 管道用法 +

    Searching

    简单的文本搜索,默认是递归的。

    ack-grep hello
     ack-grep -i hello
     ack-grep -v hello
     ack-grep -w hello
    -ack-grep -Q 'hello*'
    +ack-grep -Q 'hello*' +

    Search File

    对搜索结果进行处理,比如只显示一个文件的一个匹配项,或者xxx

    ack-grep --line=1       # 输出所有文件第二行
     ack-grep -l 'hello'     # 包含的文件名
    -ack-grep -L 'print'     # 非包含文件名
    +ack-grep -L 'print' # 非包含文件名 +

    File presentation

    输出的结果是以什么方式展示呢,这个部分有几个参数可以练习下

    ack-grep hello --pager='less -R'    # 以less形式展示
     ack-grep hello --noheading      # 不在头上显示文件
    -ack-grep hello --nocolor        # 不对匹配字符着色
    +ack-grep hello --nocolor # 不对匹配字符着色 +

    File finding

    没错,它可以查找文件,以省去你要不断的结合find和grep的麻烦,虽然在linux的思想是一个工具做好一件事。

    ack-grep -f hello.py     # 查找全匹配文件
     ack-grep -g hello.py$    # 查找正则匹配文件
    -ack-grep -g hello  --sort-files     # 查找然后排序
    +ack-grep -g hello --sort-files # 查找然后排序 +

    File Inclusion/Exclusion

    文件过滤,个人觉得这是一个很不错的功能。如果你曾经在搜索项目源码是不小心命中日志中的某个关键字的话,你会觉得这个有用。

    ack-grep --python hello       # 查找所有python文件
    -ack-grep -G hello.py$ hello   # 查找匹配正则的文件
    +ack-grep -G hello.py$ hello # 查找匹配正则的文件 +

    参考资料

    @@ -111,7 +119,7 @@ ack-grep -G hello.py$ hello # 查找匹配正 - - + + \ No newline at end of file diff --git a/c/alias.html b/c/alias.html index b05246716e..9c5e4b9a8e 100644 --- a/c/alias.html +++ b/c/alias.html @@ -10,7 +10,7 @@ alias 命令,Linux alias 命令详解:定义或显示别名。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -41,7 +41,8 @@

    alias

    定义或显示别名。

    -

    概要

    alias [-p] [name[=value] ...]
    +

    概要

    alias [-p] [name[=value] ...]
    +

    主要用途

    -

    选项

    -p:显示全部已定义的别名。
    +

    选项

    -p:显示全部已定义的别名。
    +

    参数

    name(可选):指定要(定义、修改、显示)的别名。

    value(可选):别名的值。

    返回值

    alias返回true除非您要显示的别名未定义。

    @@ -63,7 +65,8 @@ # 定义或修改别名的值 alias ls='ls --color=auto' -alias ls='ls --color=never' grep='grep --color=never' +alias ls='ls --color=never' grep='grep --color=never' +

    知识点

    直接在shell里设定的命令别名,在终端关闭或者系统重新启动后都会失效,如何才能永久有效呢?

    使用编辑器打开~/.bashrc,在文件中加入别名设置,如:alias rm='rm -i',保存后执行source ~/.bashrc,这样就可以永久保存命令的别名了。

    因为修改的是当前用户目录下的~/.bashrc文件,所以这样的方式只对当前用户有用。如果要对所有用户都有效,修改/etc/bashrc文件就可以了。

    @@ -72,7 +75,8 @@

    在CentOS7下,这个文件是/etc/bash.bashrc。此外在CentOS7下,细看~/.bashrc文件,会发现有这样一段代码:

    if [ -f ~/.bash_aliases ]; then
       . ~/.bash_aliases
    -fi
    +fi +

    这个代码的意思就是如果存在那么就加载.bash_aliases文件,所以也可以在用户根目录下新建该文件用于单独存放命令别名设置。

    错误用法