Learn from stackexchange

Highlight the three last updated files in ls output

grep --color -E --"$(ls -rtl | tail -n3)|$"<(ls -l)
or
ls -l|grep --color -E  "$(ls -rtl | tail -n3)|$"

It uses grep with highlight on input ls -l and uses a regular expression to search for either of the inputs for the three oldest command. It also search for the end-of-line $ in order to print the whole file.

 
 

相关文章:

  • 2021-12-26
  • 2021-08-28
  • 2021-06-04
  • 2021-05-21
  • 2021-12-10
  • 2021-11-07
  • 2021-08-30
  • 2021-07-15
猜你喜欢
  • 2021-08-09
  • 2022-12-23
  • 2021-07-17
  • 2021-08-31
  • 2021-12-13
  • 2021-10-11
  • 2021-08-22
相关资源
相似解决方案