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               #显示时输出行号

原文地址:https://www.cnblogs.com/yu2000/p/3531290.html