好的,这让我发疯了...我有一个衬管来查找其中包含文本的文件..但是我无法正确排序日期和时间。它只是不会随着日期和时间的升序正确排序。有什么想法吗?
$find . -name "dm_rmc_mover*" -mtime -1 -exec grep -il "Error Message: " '{}' \; | xargs ls -ltr
输出示例...
$-rw-rw-r-- 1 root d_prod 205166 26 Jul 09:35 ./dm_rmc_mover309030.log
$-rw-rw-r-- 1 root d_prod 209695 26 Jul 09:35 ./dm_rmc_mover309015.log
$-rw-rw-r-- 1 root d_prod 208945 27 Jul 01:37 ./dm_rmc_mover25405.log
$-rw-rw-r-- 1 root d_prod 210330 27 Jul 01:37 ./dm_rmc_mover22082.log
$-rw-rw-r-- 1 root d_prod 210273 27 Jul 01:37 ./dm_rmc_mover22048.log
$-rw-rw-r-- 1 root d_prod 210330 27 Jul 01:38 ./dm_rmc_mover22059.log
$....
$-rw-rw-r-- 1 root d_prod 3294 27 Jul 08:38 ./dm_rmc_mover310651.log
$-rw-rw-r-- 1 root d_prod 3358 27 Jul 08:38 ./dm_rmc_mover310954.log
$-rw-rw-r-- 1 root d_prod 177163 27 Jul 08:39 ./dm_rmc_mover276166.log
$-rw-rw-r-- 1 root d_prod 176643 27 Jul 08:39 ./dm_rmc_mover276577.log
$-rw-rw-r-- 1 root d_prod 106788 27 Jul 09:12 ./dm_rmc_mover311916.log
$-rw-rw-r-- 1 root d_prod 3189 20 Jul 02:22 ./dm_rmc_mover52860.log
$-rw-rw-r-- 1 root d_prod 3189 20 Jul 02:22 ./dm_rmc_mover52186.log
$-rw-rw-r-- 1 root d_prod 194825 20 Jul 11:24 ./dm_rmc_mover377215.log
$-rw-rw-r-- 1 root d_prod 180234 20 Jul 11:26 ./dm_rmc_mover375105.log
$-rw-rw-r-- 1 root d_prod 147975 20 Jul 12:24 ./dm_rmc_mover412600.log
$-rw-rw-r-- 1 root d_prod 208897 20 Jul 12:24 ./dm_rmc_mover411173.log
$-rw-rw-r-- 1 root d_prod 193887 20 Jul 12:24 ./dm_rmc_mover412596.log
$-rw-rw-r-- 1 root d_prod 76626 20 Jul 13:06 ./dm_rmc_mover446896.log
$-rw-rw-r-- 1 root d_prod 135722 20 Jul 13:06 ./dm_rmc_mover446895.log
$-rw-rw-r-- 1 root d_prod 145209 20 Jul 13:08 ./dm_rmc_mover446908.log
$-rw-rw-r-- 1 root d_prod 3272 23 Jul 14:48 ./dm_rmc_mover532883.log
终于到了27号的最后三个文件!