欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

測(cè)試過(guò)程中常用的linux命令之【查看文件指定行的內(nèi)容】-創(chuàng)新互聯(lián)

   在開(kāi)展測(cè)試工作的過(guò)程中,通常要接觸到服務(wù)器,對(duì)于linux服務(wù)器,總結(jié)一些常用的命令。

創(chuàng)新互聯(lián)致力于互聯(lián)網(wǎng)網(wǎng)站建設(shè)與網(wǎng)站營(yíng)銷,提供成都網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、網(wǎng)站開(kāi)發(fā)、seo優(yōu)化、網(wǎng)站排名、互聯(lián)網(wǎng)營(yíng)銷、小程序開(kāi)發(fā)、公眾號(hào)商城、等建站開(kāi)發(fā),創(chuàng)新互聯(lián)網(wǎng)站建設(shè)策劃專家,為不同類型的客戶提供良好的互聯(lián)網(wǎng)應(yīng)用定制解決方案,幫助客戶在新的全球化互聯(lián)網(wǎng)環(huán)境中保持優(yōu)勢(shì)。
  •    準(zhǔn)備工作

    為了能直觀展示命令結(jié)果,使用腳本創(chuàng)建一個(gè)文件,在顯示文件內(nèi)容的同時(shí),也直觀的顯示行號(hào)。

#!/bin/bash

FileName=TestFile.log
touch ./$FileName

i=1
while [ $i -le $1 ]
do
        echo "the line number is $i" >> $FileName
        let "i=$i+1"
done

命令選項(xiàng)示例
head-n,顯示行數(shù)
[root@Durian scripts]# head -n 5 TestFile.log 
the line number is 1
the line number is 2
the line number is 3
the line number is 4
the line number is 5

#顯示文件的前5行

[root@Durian scripts]# head -n -6 TestFile.log 
the line number is 1
the line number is 2
the line number is 3
the line number is 4
the line number is 5
the line number is 6
the line number is 7
the line number is 8
the line number is 9
the line number is 10
the line number is 11
the line number is 12
the line number is 13
the line number is 14

#截去后6行,顯示剩余內(nèi)容


[root@Durian scripts]# head TestFile.log 
the line number is 1
the line number is 2
the line number is 3
the line number is 4
the line number is 5
the line number is 6
the line number is 7
the line number is 8
the line number is 9
the line number is 10

#當(dāng)沒(méi)有選項(xiàng)參數(shù)時(shí),默認(rèn)顯示前10行

-v ,在首行打印文件名稱
[root@Durian scripts]# head -n 5 -v TestFile.log 
==> TestFile.log <==
the line number is 1
the line number is 2
the line number is 3
the line number is 4
the line number is 5

#在首行打印文件名稱

tail-n,顯示行數(shù)
[root@Durian scripts]# tail -n 4 TestFile.log 
the line number is 17
the line number is 18
the line number is 19
the line number is 20

#查看messages文件的最后4行內(nèi)容


[root@Durian scripts]# tail -n +5 TestFile.log 
the line number is 5
the line number is 6
the line number is 7
the line number is 8
the line number is 9
the line number is 10
the line number is 11
the line number is 12
the line number is 13
the line number is 14
the line number is 15
the line number is 16
the line number is 17
the line number is 18
the line number is 19
the line number is 20

#截去前4行,顯示剩余內(nèi)容


[root@Durian scripts]# tail TestFile.log 
the line number is 11
the line number is 12
the line number is 13
the line number is 14
the line number is 15
the line number is 16
the line number is 17
the line number is 18
the line number is 19
the line number is 20

#當(dāng)沒(méi)有選項(xiàng)參數(shù)時(shí),默認(rèn)顯示最后10行

-f

tail -f /var/log/messages

#當(dāng)文件內(nèi)容有更新時(shí),動(dòng)態(tài)的顯示最新的內(nèi)容

-v ,在首行打印文件名稱
[root@Durian scripts]# tail -v -n 3 TestFile.log 
==> TestFile.log <==
the line number is 18
the line number is 19
the line number is 20

#在首行打印文件名稱


[root@Durian scripts]# head -n 15 TestFile.log |tail -n 5
the line number is 11
the line number is 12
the line number is 13
the line number is 14
the line number is 15

#查看中間行第11~15行的內(nèi)容

sed-n,與p一起使用
[root@Durian scripts]# sed -n '10p' TestFile.log 
the line number is 10
#查看第10行的內(nèi)容

[root@Durian scripts]# sed -n '11,14p' TestFile.log 
the line number is 11
the line number is 12
the line number is 13
the line number is 14

#查看第11~14行的內(nèi)容

vi
[root@Durian scripts]# vi +12 TestFile.log

#文件打開(kāi)后,光標(biāo)直接定位在第12行

more
[root@Durian scripts]# more -4 TestFile.log 
the line number is 1
the line number is 2
the line number is 3
the line number is 4
--More--(19%)

#顯示前4行


[root@Durian scripts]# more +4 TestFile.log 
the line number is 4
the line number is 5
the line number is 6
the line number is 7
the line number is 8
the line number is 9
the line number is 10
the line number is 11
the line number is 12
the line number is 13
the line number is 14
the line number is 15
the line number is 16
the line number is 17
the line number is 18
the line number is 19
the line number is 20

#截去前3行,顯示剩余內(nèi)容

less
[root@Durian scripts]# less +4 TestFile.lo

#截去前3行,顯示剩余內(nèi)容

分享標(biāo)題:測(cè)試過(guò)程中常用的linux命令之【查看文件指定行的內(nèi)容】-創(chuàng)新互聯(lián)
標(biāo)題網(wǎng)址:http://aaarwkj.com/article46/isieg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊(cè)、定制網(wǎng)站、Google、移動(dòng)網(wǎng)站建設(shè)、微信小程序、網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都app開(kāi)發(fā)公司
熟女少妇久久中文字幕| 国产丝袜美腿在线观看| 日韩欧美亚洲国产一区久久精品| 国产视频专区一区二区| 日本韩国欧美一区二区在线| 日韩中文字幕 在线播放| 禁止18黄色免费网站| 亚洲精品二区在线播放| 欧美激情性国产精品潮| 亚洲欧美综合另类久久| 久久一区二区视频在线观看| 日本一区二区三区免费不卡视频| 人妻熟女一区二区视频| 欧美日韩精品福利一区二区| 欧美高清一区二区在线播放| 激情图区亚洲一区二区| 日本一区二区三区精彩视频| 亚洲国产欧美日韩激情在线 | 国产91在线精品超碰人人| 欧美一区二区三区免费精品| 日本大片在线一区二区三区| 欧美黄片不用下载在线观看| 国产精品黄色片在线观看| 国产激情视频一区二区三区| 国产精品毛片在线看不卡| 99久久这里只有精品视频| 国产一区二区三区在线看片| 中文字幕日韩欧美第一页| 久久91超碰青草在哪里看| 一级片一区二区中文字幕| 亚洲综合国产中文字幕| 国产亚洲中文字幕无线乱码| 精品国产亚洲av未满十八| 国产一区av麻豆免费观看| 丁香六月五月色婷婷网| 日本午夜免费在线视频| 国产一区av剧情巨作| 日本精彩视频一区二区| 日韩中文字幕资源一区| 国产一级黄色免费大片| 激情内射日本一区二区三区|