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

測(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ā)公司
日本精品女优一区二区三区四区| 久久91亚洲精品久久91| 亚洲乱码一区二区三区人妇| 久久最新视频中文字幕| 在线看日本一区二区| 东京一区二区三区四区黄片| 亚洲综合久久五月天| av男人的天堂一区二区| 色桃子av一区二区三区| 婷婷激情综合亚洲五月色| 亚洲成av人在线观看福利| 正在播放老肥熟妇露脸| 国产欧美日韩国产欧美日| 欧美日韩精品一区二区在线| 日韩有码中文字幕一区| 少妇太爽高潮在线播放| 久久久国产精品免费看| 一级黄片一区二区三区| 日韩欧美高清一区二区| 91九色午夜在线观看| 欧美黄片网站在线观看| 美女高潮呻吟免费观看久久久| 日本中文字幕一区二区视频| 精品人妻区二区三区蜜桃| 日韩精品欧美视频久久| 自拍日韩亚洲一区在线| 91在线免费观看国产精品| 一区二区三区高清人妻| 伊人色综合久久天天五月婷| 丰满人妻大屁一区二区| 国产国语激情对白在线| 日本韩国三级伦理在线观看| 国产久精品热看久品热久热| 日本一区二区三区在线观看视频| 亚洲国内一区二区三区| 亚洲欧美一区二区国产| 在线观看视频网站一卡二卡| 国产黄的网站在线观看| 亚洲精品免费一区二区三区| 妇女人妻丰满少妇中文字幕| 亚洲一区二区精品免费视频|