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
轉載于:https://www.cnblogs.com/bevis/archive/2012/04/08/2437375.html
總結
以上是生活随笔為你收集整理的LInux查看文件内容的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 初识2008
- 下一篇: android activityMana