How to add, delete, check and modify gracefully (3): Add, delete, check and modify for business traditional relational database users

Command introduction

The 7z command is a compression and decompression tool in Linux systems. It can be used to create, compress and decompress files in 7z format. 7z is a high-compression file format that generally has higher compression rates than other common compression formats such as zip and gzip.

Command installation

Enter the following command to install 7-Zip in Linux.

# Ubuntu 系统
apt-get update
apt-get install p7zip-full -y

# CentOS   
sudo yum install epel-release
yum install p7zip p7zip-plugins

Command description

使用方法: 7z <命令> [<开关>...] <archive_name> [<file_names>...]

<命令>
  a : 添加文件到存档
  b : 基准测试
  d : 从存档中删除文件
  e:从档案中提取文件(不使用目录名)。
  h:计算文件的哈希值
  i : 显示支持的格式信息
  l : 列出档案的内容
  rn : 重命名档案中的文件
  t : 测试档案的完整性
  u : 更新档案中的文件
  x : 提取完整路径的文件

<开关>
  --:停止开关解析
  @listfile : 设置包含文件名的列表文件的路径
  -ai[r[-|0]]{@listfile|!wildcard} : 包括归档文件
  -ax[r[-|0]]{@listfile|!wildcard} : 排除档案。
  -ao{a|s|t|u} : 设置覆写模式
  -an : 禁用档案名称字段
  -bb[0-3] : 设置输出日志级别
  -bd : 禁用进度指示器
  -bs{o|e|p}{0|1|2}:设置输出/错误/进度行的输出流
  -bt : 显示执行时间统计
  -i[r[-|0]]{@listfile|!通配符} : 包括文件名
  -m{Parameters} : 设置压缩方法
  -mmt[N] : 设置CPU线程的数量
  -mx[N] : 设置压缩级别: -mx1 (最快) ... -mx9 (超强)
  -o{Directory} : 设置输出目录
  -p{Password} : 设置密码
  -r[-|0] : 重新搜索子目录
  -sa{a|e|s} : 设置存档名称模式
  -scc{UTF-8|WIN|DOS}:设置控制台输入/输出的字符集。
  -scs{UTF-8|UTF-16LE|UTF-16BE|WIN|DOS|{id}}:设置列表文件的字符集。
  -scrc[CRC32|CRC64|SHA1|SHA256|*] :为x、e、h命令设置哈希函数。
  -sdel : 压缩后删除文件
  -seml[.] : 通过电子邮件发送档案
  -sfx[{name}] : 创建SFX档案
  -si[{name}] : 从stdin读取数据
  -slp : 设置大型页面模式
  -slt : 显示l(List)命令的技术信息
  -snh : 将硬链接存储为链接
  -snl : 将符号链接存储为链接
  -sni : 存储NT安全信息
  -sns[-] : 存储NTFS备用流
  -so : 向stdout写数据
  -spd : 禁用文件名的通配符匹配
  -spe : 消除提取命令中根文件夹的重复。
  -spf : 使用完全合格的文件路径
  -ssc[-] : 设置敏感的大小写模式
  -ssw : 压缩共享文件
  -stl : 从最近修改的文件设置存档时间戳
  -stm{HexMask} : 设置CPU线程亲和力掩码(十六进制数字)。
  -stx{Type} : 排除存档类型
  -t{Type} : 设置存档的类型
  -u[-][p#][q#][r#][x#][y#][z#] [!newArchiveName] : 更新选项
  -v{大小}[b|k|m|g] : 创建卷册
  -w[{path}] : 指定工作目录。空的路径意味着一个临时目录
  -x[r[-|0]]{@listfile|!wildcard} : 排除文件名。
  -y : 假设所有的查询都是肯定的

ab command

Command introduction

ab is the abbreviation of ApacheBench, which is a tool used to test the performance of HTTP servers. It is part of the Apache HTTP server and can be used in Linux systems through the command line.

The ab tool can simulate multiple concurrent users sending requests to the target server, and record the server's response time, throughput and other performance indicators. It can help developers and system administrators evaluate server performance bottlenecks, find out where the system bottlenecks are, and optimize performance.

Command installation

If the system is not installed, use the following command to install it

# Ubuntu
sudo apt-get install apache2-utils

# Centos
yum install httpd-tools

The ab command  is a tool for testing your Apache http server. You can use this tool to specify the number of requests sent to apache within a unit time to see how well your Apache and machine work together.

Command description

grammar

ab [ -A auth-username:password ] [ -c concurrency ] [ -C cookie-name=value
] [ -d ] [ -e csv-file ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [
-i  ]  [  -k  ]  [  -n  requests  ] [ -p POST-file ] [ -P proxy-auth-user‐
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

Options

-A auth-username:password
      #  支持基本的验证证书,用户名和密码之间使用"冒号"                    :
      # 分隔开,ab将以明文方式传送过去.不管服务器是不是需要
      # ,也就是说你的服务器需要支持401认证.

-c concurrency
      # 同时向服务器端发送的请求数目,默认状态下是一次 只执行一个http请求.

-C cookie-name=value
      # Add a Cookie: line to the request. The argument is typically in the
      # form of a name=value pair. This field is repeatable.

-d    #  Do not display  the  "percentage  served  within  XX  [ms]  table".
      # (legacy support).

-e csv-file
      # Write  a  Comma  separated value (CSV) file which contains for each
      # percentage (from 1% to 100%) the time (in milli seconds) it took to
      # serve  that percentage of the requests. This is usually more useful
      # than the 'gnuplot' file; as the results are already 'binned'.

-g gnuplot-file
      # Write all measured values out as a 'gnuplot' or TSV  (Tab  separate
      # values)  file.  This file can easily be imported into packages like
      # Gnuplot, IDL, Mathematica, Igor or even Excell. The labels  are  on
      # the first line of the file.
-h    # 显示使用说明
-H custom-header
      # 向请求包追加附加的标题字串.此参数应该是有效的标题         行(header
      # line)形式,通常使用冒号":"来分隔有效配对 (valid  pair)例如  'Accept-
      # Encoding: zip/zop;8 bit';

-i    # 使用一个 http 头(HEAD) 来替换 GET方法.不可以掺入POST 方法

-k    #  允许http      KeepAlive      ;也就是说执行多个请求在一个      http
      # 会话当中,默认是不允许的也就是no KeepAlive啦;)

-n requests
      # 执行一次测试会话的时候所发出的请求数目,默认是执行一个单一的请求
      # 当然了这样的测试结果也就没什么意义了

-p POST-file
      # 测试程序也就是ab,将向Apache server发送带有HTTP POST 的请求.

-P proxy-auth-username:password
      # 当需要通过代理测试一台 HTTP 服务器的时候而你的代理
      # 又需要用户名密码验证,这时你可以使用这个选项,同样
      # 用户名与密码之间使用冒号":"分隔开,ab将之以明文的方式
      # 发送出去,当然,前提是你的代理是处于407认证状态的

-q    #  When processing more than 150 requests, ab outputs a progress count
      # on  stderr  every  10% or 100 requests or so. The -q flag will sup‐
      # press these messages.

-s    #  When compiled in (ab -h will show you) use the SSL protected  https
      # rather  than  the  http  protocol. This feature is experimental and
      # very rudimentary. You probably do not want to use it.

-S    #  Do not display the median and standard deviation values,  nor  dis‐
      # play  the  warning/error  messages  when the average and median are
      # more than one or two times the standard deviation  apart.  And  de‐
      # fault to the min/avg/max values. (legacy support).

-t timelimit
      #  设置测试的时间的长短,使用这个选项ab将自动设置
      # 测试请求会话数目为50000,然后以你设置的时间为
      # 固定周期.默认状态下是没有时限的,也就是直到完成
      # 你所设置的请求数目为止.

-T content-type
      # 内容类型标头,使用在POST数据的时候.

-v verbosity
      # 设置冗余级别,4级打印出每个请求标头的详细信息,
      # 3级打印出回应代码(例如,404,200),2级打印出警告 信息和指示消息

-V    # 显示版本号并且退出
-w    # 打印输出结果到HTML表中. 默认的表是两列n行白底黑框

-x <table>-attributes
      # 使用字串来描述表的属性,该属性字串应该插入到<table 这里 >

-X proxy[:port]
      # Use a proxy server for the requests.

-y <tr>-attributes
      # 用于生成html表格每行的属性名 (<tr>)

-z <td>-attributes
      # 用于生成html表格每列的属性名 (<td>)

accept command

Command introduction

In Linux, the accept command is used to accept an incoming network connection. It is often used with socket programming to create a server program to listen and accept connection requests from clients.

Command description

The syntax of the accept command is as follows:

Options:

-a:显示连接的详细信息,包括用户ID、远程主机名、远程IP地址等。
-d:启用调试模式,显示更多的调试输出信息。
-r:拒绝连接请求。

File descriptor:
- An integer value representing the socket file descriptor to which connections are to be accepted.

The accept command works as follows:
1. Create a socket and bind it to a specific IP address and port number.
2. Use the listen function to set the socket to the listening state and wait for the client's connection request.
3. Use the accept function to accept the client's connection request and return a new socket file descriptor for communicating with the client.
4. Use the new socket file descriptor for data transfer.

Example of using the accept command:

The above command will run the accept command in debug mode and accept incoming connections using file descriptor 3.

It should be noted that the accept command itself is not an independent command, but a tool used to demonstrate and test network programming. In an actual production environment, we usually use the socket library provided by the programming language to accept and process network connections.

ack command

Command introduction

The ack command is a tool used to search the contents of files in Linux systems. It is a replacement for grep command with faster search speed and friendlier output format.

Command installation

If the system is not installed, use the following command to install it

# Ubuntu
sudo apt-get install apache2-utils

# Centos
yum install httpd-tools

Command description

The following are some common options and usage of the ack command:

1. Basic usage:

ack [选项] 搜索模式 [文件/目录]

2. Options:

-i:忽略大小写
-w:只匹配整个单词
-c:只显示匹配的行数
-l:只显示包含匹配的文件名
-r:递归搜索子目录
-n:显示匹配的行号
-v:反向匹配,只显示不包含搜索模式的行
-o:只显示匹配的部分
-g:指定搜索模式的文件类型(例如:--perl、--python)

3. The ack command also supports some advanced usage, such as using regular expressions to search, custom search pattern files, etc. You can view the complete help documentation through the man ack command.

Summary: The ack command is a powerful file content search tool. It can quickly search file content in the Linux system and provides a wealth of options and usage to facilitate users to perform customized search operations according to their needs.

Guess you like

Origin blog.csdn.net/udisi658996666/article/details/132673087