【发布时间】:2018-06-11 01:32:09
【问题描述】:
你好,有人可以帮我解决这个问题吗?
如何编写一个以文件名作为参数并以这种方式准确显示其修改日期和时间的脚本:
[user@localhost...]$ bash script.sh temp.txt
the file temp.txt was modified on May 1 20:20
然后修改该脚本,使其列出名称包含给定模式的目录的修改日期:
[user@local....]$ bash script.sh testRegex Pub
the file testRegex was modified on May 1 20:22
the directory /home/user/Public was modified on Dec 26 08:00
the directory /home/user/Pubs. was modified on May 2 20:00
请帮我快速回答这个问题
谢谢
【问题讨论】:
-
我们不会为你做作业,目前还不清楚你到底在坚持什么。但也许看看stat 命令会对您有所帮助。
-
您在下面对其中一个答案的评论有点幽默:“谢谢,但我真的不能用这个,截止日期是 2 天,我没有参加这个当然,但我正在尝试尽可能多地理解并使用它,但我被困住了。任何更简单的帮助真的意义重大。”。我们真的需要为像您这样的人提供 Give Mez The Codez 堆栈交换。