001、 root@PC1:/home/test3# ls root@PC1:/home/test3# seq 1000 > a.txt ## 生成一个测试文件 root@PC1:/home/test3# ls a.txt root@PC1:/home/test3# sha1sum a.txt ## 使用sha1sum命令生成sha1码 234e7e9c9c8490946d3e8c2a01bff41e9acce2
最近在看C语言代码时碰到了这个问题,结合查找的资料对这C的知识点做了一下小结。写了一份测试它们的代码。test1函数穿了一个char* const的指针,如果对它增加,会报错,它是只读的。但是可以对指针所指位置的内容进行更改。test2函数测试的是const char类型的参数,test3函数测试的是ch
001、 root@PC1:/home/test3# ls a.txt root@PC1:/home/test3# cat a.txt e r e y e u e e e g e 3 h r 1 3 e g e y e e s e e e e e root@PC1:/home/test3# cp a.txt a.txt_bak root@PC1:/home/test3# max=$(awk -F "e" '{print NF - 1}' a.txt | sor
001、 root@PC1:/home/test3# ls a.txt root@PC1:/home/test3# cat a.txt ## 测试数据, 统计每一行出现的k的次数 j k u k r k s k j u e a f d e u i w j j k k e f root@PC1:/home/test3# awk -F "k" '{print NF - 1}' a.txt ## awk实现 3 1 0 2 002、awk循环实现
通过 监控端口 来确定应用程序是否在运行 1、在~/zabbix_agentd 目录下创建文件 #vim userparameter_nginx_80.conf(只要以.conf结尾就可以) UserParameter=键值,命令(或者.sh脚本) [root@test3 zabbix_agentd]# cat userparameter_nginx_80.conf UserParameter=nginx_80,ss -lntup
001、 root@DESKTOP-1N42TVH:/home/test3# ls test.txt root@DESKTOP-1N42TVH:/home/test3# cat test.txt ## 测试数据 AKCR02000001 df AKCR02000001 df AKCR02000001 er AKCR02000001.1 dg AKCR02000001.1 der AKCR02000001.1 fg AKCR02000001.2 ee AKCR0200
1、 root@PC1:/home/test3# ls a.txt root@PC1:/home/test3# cat a.txt 1 e d 2 a g 3 w e 4 d g 5 g j 6 e j 7 l m 8 i n root@PC1:/home/test3# a=3 ## 行号 3 root@PC1:/home/test3# b=6 ## 行号 6 root@PC1:/ho
#内部含有__iter__方法的都是可迭代对象 for i in '123': print(i) print(dir('123'))#输出对象所有内部方法 print('__iter__' in dir(str))#True print('__iter__' in dir(dict))#True print('__iter__' in dir(list))#True print('__
1、将文本中的所有d替换为QQ [root@PC1 test3]# ls a.txt test.py [root@PC1 test3]# cat a.txt erg iuy dfg fdf er4 435 dft 34f cgd err [root@PC1 test3]# cat test.py #!/usr/bin/python in_file = open("a.txt", "r") out_file = open("result.txt&q
1、删除第一列 [root@PC1 test3]# ls a.txt test.py [root@PC1 test3]# cat a.txt 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 [root@PC1 test3]# cat test.py #!/usr/bin/python in_file
1、 [root@PC1 test3]# ls a.txt [root@PC1 test3]# cat a.txt ## 测试数据 8.34565 3.23445 7.32423 0 8.343532523 5.34355 3.355623253 0 0 [root@PC1 test3]# awk '{for(i = 1; i <= NF; i++) printf("%.3f\t", $i); printf("\n")}'
简介 JSON(JavaScript Object Notation, JS对象简谱)是一种轻量级的数据交换格式,通常是以键值对的方式呈现,其简洁和清晰的层次结构使得JSON成为理想的数据交换语言,而在Python中处理JSON格式的模块有json和pickle两个。 json模块和pickle都提供了四个方法:dumps, dump, loads, load
先执行test1(),再执行test2: function test1() { return new Promise(resolve => { setTimeout(() => resolve("test1"), 2000); }); } function test2() { console.log("test2"); } async function test3() { const result =
1、举例%.*的作用 root@DESKTOP-1N42TVH:/home/test3# a="aa.bb.cc.dd" root@DESKTOP-1N42TVH:/home/test3# echo ${a} aa.bb.cc.dd root@DESKTOP-1N42TVH:/home/test3# echo ${a%.*} ## %.*的作用是删除变量最后一个.及其后的内容 aa.bb.cc root@DESKTOP-1N42TVH:/ho
# ElasticSearch version "number": "7.14.1" # 获取健康值 GET _cat/health?v # 获取所有的信息 GET _cat/indices?v # mappings信息======================================= # 创建test3索引 # mapping number_of_shards分片数 # number_of_replicas版本数 PUT /test3 {
1、测试数据 [root@centos7 test3]# ls test.txt [root@centos7 test3]# cat test.txt deet dggh df 2、awk实现 [root@centos7 test3]# ls test.txt [root@centos7 test3]# cat test.txt deet dggh df [root@centos7 test3]# awk '{print length}' test.txt 4 4 2 [
1、测试数据 root@DESKTOP-1N42TVH:/home/test3# ls a.txt root@DESKTOP-1N42TVH:/home/test3# cat a.txt e t d u e i a d g g z j c b d e w l z c b h j h 2、形式1 root@DESKTOP-1N42TVH:/home/test3# cat a.txt e t d u e i a d g g z j c b d e w l z c b h j h ro
1、 root@DESKTOP-1N42TVH:/home/test3# ls a.txt root@DESKTOP-1N42TVH:/home/test3# cat a.txt chr168 0.5 0.66 0.77 0.3 chr254 0.6 0.3 0.89 chr678 0.658 0.5 chr344 0.53 0.596 0.65 0.68 root@DESKTOP-1N42TVH:/home/test3# awk -v RS='chr' 'NR!=1{
1、测试数据 root@DESKTOP-1N42TVH:/home/test3# ls a.txt root@DESKTOP-1N42TVH:/home/test3# cat a.txt ## 测试数据 01 02 AAA 03 04 05 BBB 06 07 08 CCC 09 10 2、匹配AAA到BBB之间的数据 root@DESKTOP-1N42TVH:/home/test3# cat a.txt 01 02 AAA 03 04 05 BBB 06
$RANDOM 是linux中的内置变量,可以随机生成 0~32767之间的整数数字。 1、取0~9的随机数 [root@centos7pc1 test3]# ls [root@centos7pc1 test3]# expr $RANDOM % 10 7 [root@centos7pc1 test3]# expr $RANDOM % 10 2 [root@centos7pc1 test3]# expr $RANDOM % 10 0 [root@centos
1.使用timedatectl查看时间状态 列出所有已知时区 修改时区为列出时区的某一个 2.使用wget命令在https://www.pearvideo.com/这个网站下载任意一个视频 3.Linux中的文件类型以及符号的表示 4.创建目录test,并使用一条命令在test下创建 test1/test2/test3 a.输出test3的
Condition (function or variable) :条件(函数或变量)。条件为 Flase 的时候,才会跳出 While 循环,否则一直执行 While 控制器下的样例。 1、不填(空):当 While 控制器下最后一个样例执行失败后 跳出循环 test1、test2、test3,都能运行成功,会一直运行下去,陷入死循环 te
前言 本文将基于以下三种关系型数据库,对 sequence (序列) 展开讨论。 Oracle - 应用最广泛的商用关系型数据库 PostgreSQL - 功能最强大的开源关系型数据库 MySQL - 应用最广泛的开源关系型数据库 sequence 适用场景 主键 用于整型主键数据的生成,一般一个 sequence 仅用于一张表的
一、基础操作命令 1、创建目录:mkdir 文件名 2、进入指定目录:cd 目录名 3、切换至上一级目录:cd .. 4、创建工作空间:git init 5、创建文件:vi 文件名,esc+i进入编辑模式,esc+ZZ退出编辑模式 6、提交至暂存区:git add * 7、提交版本:git commit -m "版本说明" 8、修改文件名称:mv 旧文件
import numpy as np #导入科学计算库 import matplotlib.pyplot as plt a=np.arange(10) plt.plot(a/a/a,a*2,'ro-',label='a') plt.plot(a^2,a*2.5,'gx--',label='b') plt.plot(a,a*1.5,'y*-',label='c') plt.plot