歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> linux查看文件內容命令

linux查看文件內容命令

日期:2017/3/1 14:05:11   编辑:關於Linux
linux查看文件內容命令 cat 由第一行開始顯示文件內容 tac 從最後一行開始顯示 nl 顯示同時輸出行號 more 一頁一頁的顯示內容 less 與more類似,但其優點是,可以往前翻頁 head 只看頭幾行 tail 只看未尾幾行 od 以二進制的方式讀取文件內容 cat [-n] -n連行號一起輸出到屏幕上 與nl相似 more [文件名] more test.txt將test.txt一頁一頁的顯示出來 ls -al | more將ls顯示的內容一頁頁顯示出來 less [文件名] less的用法比more更有彈性,使用less可以用pageup、pagedown翻看 less test.txt /word 在test.txt中搜尋word這個字符串 :q 退出less head [-n number] [文件名] -n顯示number行 head -n 20 test.txt 顯示test.txt前20行 tail [-n number] [文件名] -n顯示number行 tail -n 20 test.txt 顯示test.txt後20行 head -n 20 test.txt | tail -n 10 取11-20行 hexdump
Copyright © Linux教程網 All Rights Reserved