需要帮助列出具有如下模式的文件:
Sep 19 00:02 gc-2019-08-18_07-23-09.log.1.current.zip
Sep 19 00:02 gc-2019-08-21_07-58-10.log.3.current
Sep 19 00:02 gc_2019-08-25_07-58-11.log.5.current
Sep 19 01:41 gc_2019-09-18_17-40-28.log.0.current
我只想获取以 gc 开头并以 .current 结尾的文件。
问题是我不想使用 "ls -ltr gc*"
因为我有一些其他不想打印的以 gc 开头的文件?
有人可以为此提供建议吗?
最佳答案
尝试使用 find
和 glob 模式:
find . -name 'gc*.current'
关于linux - 如何在 Linux 中列出以特定模式开头和结尾的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58002662/