- 论坛徽章:
- 0
|
怎样查找某个目录下在某个时间段内所有修改过的文件包括子目录下
经过重重艰难险阻终于能列出东东了,看来还是我的基础太差了,连单引号和撇号都没有分清楚。
可是我发现 Apr 7 11:34 .profile文件怎么会列出来?他不在我的时间范围之内呀?
# ls -alF
total 42
drwxr-xr-x 9 oracle dba 512 Apr 8 12:58 ./
drwxr-xr-x 10 root root 512 Apr 8 11:15 ../
-rw------- 1 oracle dba 146 Apr 8 12:52 .TTauthority
-rw------- 1 oracle dba 101 Apr 8 12:52 .Xauthority
drwxr-xr-x 11 oracle dba 512 Apr 8 13:30 .dt/
-rwxr-xr-x 1 oracle dba 5111 Apr 7 11:41 .dtprofile*
-rw-r--r-- 1 oracle dba 582 Apr 7 11:34 .profile
-rw------- 1 oracle dba 1644 Apr 8 16:12 .sh_history
drwx------ 2 oracle dba 512 Apr 8 12:52 .solregis/
-rwxrwxrwx 1 root other 161 Apr 9 09:27 1.sh*
-rw-r--r-- 1 oracle dba 404 Apr 8 12:50 2
drwxr-xr-x 40 oracle dba 1024 Apr 8 13:20 OraHome1/
drwxrwxr-x 3 oracle dba 512 Apr 8 12:58 jre/
drwx------ 10 oracle dba 512 Apr 8 12:58 oraInventory/
drwxrwxr-x 3 oracle dba 512 Apr 7 13:15 oracle1/
drwxrwxr-x 6 oracle dba 512 Apr 8 12:58 oui/
# cat 1.sh
begin='Apr 7 11:35'
end='Apr 8 11:35'
cat - <<! | sort +5M +6n +7n | sed -n "/$begin/,/$end/p"
- - - - - $begin - - - -
-
- - - - - $end - - - -
-
`ls -alF`
!
# ./1.sh
- - - - - Apr 7 11:35 - - -
- -
-rw-r--r-- 1 oracle dba 582 Apr 7 11:34 .profile
-rwxr-xr-x 1 oracle dba 5111 Apr 7 11:41 .dtprofile*
drwxrwxr-x 3 oracle dba 512 Apr 7 13:15 oracle1/
- - - - - Apr 8 11:35 - - -
- - |
|