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

測(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ā)公司
日本韩国欧美一区二区在线| 97人妻精品一区二区三区六| 亚洲精品国产熟女av| 国内自拍韩国资源在线| 国产视频三级在线观看| 91在线播放欧美国产视频| 人妻一区二区三区免看| 亚洲成年人黄片在线播放| 性知音国产精品粉色视频| 日韩黄色大片免费在线观看| 国产日韩欧美另类综合| 91人妻互换一区二区| 亚洲中文自偷自拍另类| 欧美日韩电影一区二区三区| 国产欧美一区二区另类精品| 自偷自拍在线免费观看| 亚洲1区2区中文字幕| 亚洲中文字幕第三页在线观看| 亚洲欧美一区二区三区日本| 国产精品亚洲av性色| 欧美精品一区二区网址| 国产精品欧美日韩中文| 熟年人妻一区二区三区| 91一区二区亚洲嫩草| 免费高清视频一区二区在线观看| 日韩在线不卡免费视频一区| 欧美午夜福利一级高清| 国产91黑丝视频在线观看| 亚洲av色男人天堂网| 在线观看国产高清自拍| 亚洲一区有码在线观看| 国产一级黄色录像大片| 麻豆国产精品原创av男女| 欧美日本国产老熟女视频| 放荡精品少妇一区二区三区| 人妻一少妇一区二区三区| 激情亚洲综合一区二区| 偷拍一区二区三区四区| 五月天久久开心激情网| 五十路八十路息与子交尾| 日本精彩视频一区二区|