![ksh:특정 날짜에 생성된 파일을 [중복] 디렉토리에 가져옵니다.](https://rvso.com/image/51199/ksh%3A%ED%8A%B9%EC%A0%95%20%EB%82%A0%EC%A7%9C%EC%97%90%20%EC%83%9D%EC%84%B1%EB%90%9C%20%ED%8C%8C%EC%9D%BC%EC%9D%84%20%5B%EC%A4%91%EB%B3%B5%5D%20%EB%94%94%EB%A0%89%ED%86%A0%EB%A6%AC%EC%97%90%20%EA%B0%80%EC%A0%B8%EC%98%B5%EB%8B%88%EB%8B%A4..png)
특정 날짜에 생성된 파일을 디렉토리에 가져오고 싶습니다.
> ll
total 36
-rw-rw-r-- 1 tak tak 212 Oct 08 07:06 name.log
-rw-rw-r-- 1 tak tak 494 Oct 09 09:24 rep.083011
-rw-rw-r-- 1 tak tak 494 Oct 08 05:27 rep.083221
-rwxrwxr-x 1 tak tak 914 Oct 09 09:29 names.ksh
-rw-rw-r-- 1 tak tak 331 Oct 08 09:28 report_091020130928.txt
-rw-rw-r-- 1 tak tak 331 Oct 09 12:00 report_091020131200.txt
drwxrwxr-x 2 tak tak 2048 Oct 08 08:44 error
-rwxrwxr-x 1 tak tak 2 Oct 09 08:36 sample.ksh
-rw-rw-r-- 1 tak tak 92 Oct 08 06:17 x.log
나는 아래 명령을 사용했다
find . -type f -newer 2013-10-08 ! -newer 2013-10-08
오류가 발생했습니다.
find: 0652-015 Cannot access file 2013-10-07
답변1
에서 man find
:
-newer file
File was modified more recently than file. If file is a sym‐
bolic link and the -H option or the -L option is in effect, the
modification time of the file it points to is always used.
테스트 -newer
에서는 다음을 기대합니다.파일날짜 문자열이 아닌 인수로. 따라서 올바른 수정 날짜가 있는 파일을 가리키거나 다음을 사용할 수 있습니다 -mtime
.
-mtime n
File's data was last modified n*24 hours ago. See the comments
for -atime to understand how rounding affects the interpretation
of file modification times.
Numeric arguments can be specified as
+n for greater than n,
-n for less than n,
n for exactly n.