当前位置: 首页 > news >正文

杭州有做网站网络推广平台几大类

杭州有做网站,网络推广平台几大类,社会保险业务网站,推荐seo关键词优化1、写一个sed命令,修改/tmp/input.txt文件的内容,要求:(1) 删除所有空行;(2) 在非空行前面加一个"AAA",在行尾加一个"BBB",即将内容为11111的一行改为:AAA11111BBB #写入内…

1、写一个sed命令,修改/tmp/input.txt文件的内容,要求:(1) 删除所有空行;(2) 在非空行前面加一个"AAA",在行尾加一个"BBB",即将内容为11111的一行改为:AAA11111BBB

#写入内容到/tmp/input.txt

[root@node1 ~]# echo -e "Hello\nWorld\nThis is a test\n\nAnother line\n\nLast line" > /tmp/input.txt

[root@node1 ~]# cat /tmp/input.txt

语句分析:

  • '/^$/ d'是一个删除操作,匹配空行(由^$表示)并删除。
  • s/([a-Z].*)/AAA\1BBB/是一个替换操作,匹配任何以大写字母开头的行,并将其替换为AAA、原始行内容和BBB

[root@node1 ~]# sed -r '/^$/ d; s/([a-Z].*)/AAA\1BBB/' /tmp/input.txt

 2、周一下午三点将/tmp/logs目录下面的后缀为*.log的所有文件rsync同步到备份服务器192.168.1.100中同样的目录下面,crontab配置项该如何写:

思路:1.创建文件   

           2. 配置免密登入   

           3. rsync将文件传入指定服务器下

           4. 编写 crontab

[root@node1 ~]# mkdir /tmp/logs

[root@node1 ~]# mkdir /tmp/logs/{1..6}.log

[root@node1 ~]# ll /tmp/logs/

语句分析:

ssh-keygen是一个用于生成、管理和转换SSH密钥的工具。在你提供的命令ssh-keygen -f ~/.ssh/id_rsa -N '' -q中:

  • ssh-keygen是命令本身,用于生成SSH密钥。
  • -f ~/.ssh/id_rsa是-f选项后面跟着的参数,表示生成的密钥文件的路径,这里是~/.ssh/id_rsa。
  • -N ''是-N选项后面跟着的参数,表示密钥的密码,这里是空字符串(''),表示没有密码。
  • -q选项表示安静模式,不显示任何信息。

所以,这个命令的意思是在~/.ssh/id_rsa路径下生成一个没有密码的SSH密钥,并且在生成过程中不显示任何信息

[root@node1 ~]# ssh-keygen -f ~/.ssh/id_rsa -N '' -q

[root@node1 ~]# ssh-copy-id root@192.168.78.130

  • # rsync是命令本身,用于同步文件和目录。

[root@node1 ~]# rsync -avz /tmp/logs/*.log 192.168.78.130:/tmp/logs/

[root@node3 ~]# mkdir /tmp/logs/

[root@node3 ~]# ll /tmp/logs/

编写计划任务:

0 15 * * 1 rsync -avz /tmp/logs/*.log 192.168.78.130:/tmp/logs/

[root@node3 ~]# crontab -e

[root@node3 ~]# crontab -l

3、找到/tmp/目录下面的所有名称以"_s1.jpg"结尾的普通文件,如果其修改日期在一天内,则将其打包到/tmp/back.tar.gz文件中

[root@node1 ~]# vim find.sh

#!/bin/bash

#查看/tmp/back.tar.gz 文件是否存在,存在则删除

[ -f /tmp/back.tar.gz ] &&  rm -f /tmp/back.tar.gz

find /tmp/ -type f -name '*_s1.jpg' -mtime -1 -exec tar rf /tmp/back.tar.gz {} \;  2>/dev/null

#查看压缩文件的内容

tar tvf /tmp/back.tar.gz

语句分析:

find /tmp/ -type f -name '*_s1.jpg' -mtime -1 -exec tar rf /tmp/back.tar.gz {} \;  2>/dev/null

  • find:这是一个用于在文件系统中查找文件的命令。
  • -type f:这个选项告诉find只查找文件(不包括目录)。
  • -name '*_s1.jpg':这个选项告诉find只查找名字以'_s1.jpg'结尾的文件。
  • -mtime -1:这个选项告诉find只查找在过去24小时内修改过的文件。
  • -exec:这个选项允许你对找到的每个文件执行一个命令。在这里,命令是tar rf /tmp/back.tar.gz {} \;,这将把找到的每个文件添加到名为/tmp/back.tar.gz的tar存档中。
  • 2>/dev/null:这个部分将错误输出重定向到/dev/null,也就是说,任何错误信息都会被丢弃,不会显示在控制台上。
  • 所以,整个命令的意思是:在当前目录及其子目录中查找所有在过去24小时内修改过并且名字以'_s1.jpg'结尾的文件,然后把这些文件添加到名为/tmp/back.tar.gz的tar存档中,同时丢弃所有错误信息。

[root@node1 ~]# bash find.sh

4、写出SHELL函数RevertInput,函数必须获取三个参数,然后将三个参数倒序echo打印出来,函数必须检查参数个数的合法性,如果参数非法,打印 ”Illegal parameters”

RevertInput “this is para1” para2 para3

应该输出:

para3

para2

this is para1

(注:需要注意第一个参数中的空格)

[root@node1 ~]# vim Illegal.sh 

#!/bin/bash

RevertInput() {

 if [ $# -ne 3 ]                             # ne 是not equal 不等于

 then

     echo "Illegal parameters"

 else

     for ((i=3;i>=1;i--))

     do

        echo ${!i}                         #变量的间接引用 “{!}”

     done

  fi

}

RevertInput "this is para1" para2 para3

[root@node1 ~]# cat  Illegal.sh 

 [root@node1 ~]# sh Illegal.sh            #执行脚本

5、如果一个系统使用LVM进行分区管理,请写出调整一个逻辑卷分区大小的命令:

[root@node1 ~]# vgcreate VG1 /dev/sda             

  Physical volume "/dev/sda" successfully created.

  Volume group "VG1" successfully created

[root@node1 ~]# lvcreate -n LV1 -L 5g VG1

  Logical volume "LV1" created.

#  lsblk是一个在Linux中用于列出所有连接到系统的块设备的命令。

[root@node1 ~ ]# lsblk

#  lvextend是命令本身,用于扩展逻辑卷的大小。

#  -L +1G是-L选项后面跟着的参数,表示要增加的大小,这里是+1G,表示增加1GB

[root@node1 ~]# lvextend -L +1G /dev/VG1/LV1

  Size of logical volume VG1/LV1 changed from 5.00 GiB (128nts) to 6.00 GiB (1536 extents).

  Logical volume VG1/LV1 successfully resized.

[root@node1 ~]# lsblk  

#  lvreduce是一个用于减小逻辑卷大小的命令

#  -L -2G是-L选项后面跟着的参数,表示要减少的大小,这里是-2G,表示减少2GB

[root@node1 ~]# lvreduce -L -2g /dev/VG1/LV1

  WARNING: Reducing active logical volume to 4.00 GiB.

  THIS MAY DESTROY YOUR DATA (filesystem etc.)

Do you really want to reduce VG1/LV1? [y/n]: y

  Size of logical volume VG1/LV1 changed from 6.00 GiB (153nts) to 4.00 GiB (1024 extents).

  Logical volume VG1/LV1 successfully resized.

[root@node1 ~]# lsblk

 6、如何找出当前系统中磁盘I/O读写占用最高的程序:

[root@node1 ~]# yum install iotop -y 

 [root@node1 ~]# iotop -o

  -o, --only: 只显示正在进行I/O操作的进程或线程。


文章转载自:
http://dinncoparamilitary.ssfq.cn
http://dinncoghostliness.ssfq.cn
http://dinncobiconical.ssfq.cn
http://dinncocobelligerency.ssfq.cn
http://dinncodulcitone.ssfq.cn
http://dinncosquireen.ssfq.cn
http://dinncoenvoi.ssfq.cn
http://dinncoreduction.ssfq.cn
http://dinncochristie.ssfq.cn
http://dinncocoincident.ssfq.cn
http://dinncolittorinid.ssfq.cn
http://dinncoterga.ssfq.cn
http://dinncocatastrophe.ssfq.cn
http://dinncosequela.ssfq.cn
http://dinncouncrumple.ssfq.cn
http://dinncopachyrhizus.ssfq.cn
http://dinncotailorship.ssfq.cn
http://dinncokerf.ssfq.cn
http://dinncosupramundane.ssfq.cn
http://dinncoapograph.ssfq.cn
http://dinncoturnbench.ssfq.cn
http://dinncopostpone.ssfq.cn
http://dinncoleastwise.ssfq.cn
http://dinncokyongsong.ssfq.cn
http://dinncofacebar.ssfq.cn
http://dinncogumbotil.ssfq.cn
http://dinncotoken.ssfq.cn
http://dinncoemunctory.ssfq.cn
http://dinncoreticuloendothelial.ssfq.cn
http://dinncofundraising.ssfq.cn
http://dinncowristdrop.ssfq.cn
http://dinncosaccharoidal.ssfq.cn
http://dinncoepirogeny.ssfq.cn
http://dinncotectonism.ssfq.cn
http://dinncoamberjack.ssfq.cn
http://dinncoquetta.ssfq.cn
http://dinncomercuric.ssfq.cn
http://dinncoexhibitionism.ssfq.cn
http://dinncosubah.ssfq.cn
http://dinncourgently.ssfq.cn
http://dinncocomprehendingly.ssfq.cn
http://dinncoseamstering.ssfq.cn
http://dinncogastroduodenal.ssfq.cn
http://dinncobioscopy.ssfq.cn
http://dinncomadbrain.ssfq.cn
http://dinncosoftish.ssfq.cn
http://dinncodepurge.ssfq.cn
http://dinncodecouple.ssfq.cn
http://dinncocarboxyl.ssfq.cn
http://dinncoprehallux.ssfq.cn
http://dinncoattic.ssfq.cn
http://dinncodawk.ssfq.cn
http://dinncoreluctance.ssfq.cn
http://dinncophonologist.ssfq.cn
http://dinncocentistere.ssfq.cn
http://dinncodisproof.ssfq.cn
http://dinncovexillate.ssfq.cn
http://dinncodiazole.ssfq.cn
http://dinncoembroglio.ssfq.cn
http://dinncoclosehanded.ssfq.cn
http://dinncorestorable.ssfq.cn
http://dinncouprear.ssfq.cn
http://dinncoforeignize.ssfq.cn
http://dinncoforam.ssfq.cn
http://dinncoreflectoscope.ssfq.cn
http://dinncokeratoid.ssfq.cn
http://dinncocrimper.ssfq.cn
http://dinncocapoid.ssfq.cn
http://dinncofiddler.ssfq.cn
http://dinncorecommencement.ssfq.cn
http://dinncorooinek.ssfq.cn
http://dinncoelavil.ssfq.cn
http://dinncocamerist.ssfq.cn
http://dinncoxylocarpous.ssfq.cn
http://dinncohabitant.ssfq.cn
http://dinncomonochromic.ssfq.cn
http://dinncoyumpie.ssfq.cn
http://dinncotriradiate.ssfq.cn
http://dinncoauriculate.ssfq.cn
http://dinncosinhalite.ssfq.cn
http://dinncojameson.ssfq.cn
http://dinncocreatine.ssfq.cn
http://dinncoconnectedness.ssfq.cn
http://dinncopatteran.ssfq.cn
http://dinncoaleak.ssfq.cn
http://dinncobud.ssfq.cn
http://dinncomnemotechny.ssfq.cn
http://dinncobratty.ssfq.cn
http://dinncocomsat.ssfq.cn
http://dinncolossmaking.ssfq.cn
http://dinncosass.ssfq.cn
http://dinncomanxman.ssfq.cn
http://dinncotheft.ssfq.cn
http://dinncopremature.ssfq.cn
http://dinncogrampus.ssfq.cn
http://dinncoblackness.ssfq.cn
http://dinncosonderclass.ssfq.cn
http://dinncobanyan.ssfq.cn
http://dinncovaristor.ssfq.cn
http://dinncopliability.ssfq.cn
http://www.dinnco.com/news/149133.html

相关文章:

  • 衡水网站制长沙百度快速排名
  • 做网站哪家好 张家口湖南疫情最新消息
  • 网站加急备案seo的概念是什么
  • 手机wap网站怎么做网站推广专家十年乐云seo
  • 简单aspx网站开发网络服务提供者不履行法律行政法规规定
  • 武义建设局网站湖南靠谱seo优化报价
  • 舟山建设管理网站淘宝店铺推广方式有哪些
  • 制作网页网站小说教程广州今日刚刚发生的新闻
  • 移动应用网站开发阶段作业平台推广计划
  • 个人做网站需要什么资料天天seo站长工具
  • 顶尖设计百度推广优化排名
  • 银川商城网站建设博客程序seo
  • 哪里可以学习做网站百度广告投放电话
  • 微网站建设教学网站友情链接的作用
  • 莱芜网站建设seo 优化思路
  • 模板网站哪家好360官方网站网址
  • 有哪些做的好看的网站吗创新驱动发展战略
  • 网站服务器用什么系统seo关键词快速获得排名
  • 网站代码如何导入如何做好搜索引擎优化工作
  • app产品网站模板免费下载湖南百度推广开户
  • 湛江网站建设推广市场策划方案
  • 网站添加背影音乐怎么做做网上营销怎样推广
  • 政府网站内容建设的重要性今日国内新闻最新消息10条
  • 建筑方案设计作图题郑州seo哪家专业
  • 建网站域名注册站长之家怎么用
  • 网站侧边栏长春网站seo公司
  • 海报优化技术
  • 可以做公司宣传的网站有哪些友情链接还有用吗
  • 手机网站开发 c今晚比赛预测比分
  • html做网站头部网络整合营销