linux下查找文件、排序、查看文件內容
本文介紹下,在linux系統中,查找文件的命令用法,以及按時間排序找到的目標文件的方法。
1.例如:查找當前目錄下所有.ini文件,並按時間排序
示例: find ./ -name *.ini |xargs ls –lta
2.按時間的排序顯示並顯示器條數
示例: ls -lt |head –n 10
3. 查看文件內容
示例:cat po-test1-2014-01-23-15.txt |less
其它方法:
cat po-test1-2014-01-23-15.txt |more
cat po-test1-2014-01-23-15.txt |head 10 #顯示前10行
cat po-test1-2014-01-23-15.txt |tail 10 #顯示后10行
cat -n #顯示時輸出行號