|
发表于 2010-12-9 15:34:02
|
显示全部楼层
Post by flzt;2120708
==========================
MS这样不行啊
看我搞的
+++++++++++++++++++++++++++++++++++++++++++++
[root@centos5 shell]# ls -al
total 24
drwxr-xr-x 2 root root 4096 Nov 22 10:34 ?
drwxr-xr-x 2 root root 4096 Nov 22 10:31 ??
drwxr-xr-x 4 root root 4096 Nov 22 10:34 .
drwxr-xr-x 3 root root 4096 Nov 22 10:12 ..
-rw-r--r-- 1 root root 409 Nov 22 10:19 rmdup.sed
-rw-r--r-- 1 root root 246 Nov 22 10:14 testtxt.file
[root@centos5 shell]# cd "`ls -l | grep 10:34`"
-bash: cd: drwxr-xr-x 2 root root 4096 Nov 22 10:34 ?: No such file or directory
[root@centos5 shell]# cd "`ls -al | grep 10:34`"
-bash: cd: drwxr-xr-x 2 root root 4096 Nov 22 10:34 ?
drwxr-xr-x 4 root root 4096 Nov 22 10:34 .: No such file or directory
这当然不行啊,你grep出来了一行,你还要得到文件名才可以
ll | grep “mtime” | tr -s " " | cut -d" " -f8 |
|