如何根据上次编辑文件的时间复制文件夹中的文件?假设我想将我今天上次编辑的所有文件从c:复制到我的文件夹bak。我怎样才能做到这一点?
我知道可以像这样完成常规复制命令:
cp source destination
Run Code Online (Sandbox Code Playgroud)
例如。
cp *.c bak
Run Code Online (Sandbox Code Playgroud)
有什么建议?
我正在使用find . -type f -mtime 0终端中的功能搜索在最后一天编辑过的文件。我想在查询中排除一些文件和文件夹,例如.DS_Store文件和.sh文件。
目前我正在这样做:
find . -type f -not -path "*.DS_Store" -and -not -path "*.sh" -mtime 0
我还有很多要排除的文件,我想知道是否可以缩短表达式。我不想写:
-not -path "PathHere" -and -not -path "AnotherPathHere" 等等。
有什么建议?