Stand Alone Complex

意见和建议请发邮件或者留言,谢谢!

 
Lables
Linux Desktop
Linux Commands
Linux Shell
Win and Laptop
Mist
Leave me a Message
U Want More ?
What you want to add? Feel free to let me know by EMail me :)
Find 命令
2008年9月14日
========测试环境: Fedora Core 6.0;内核:2.6.18========
1 关于通配符
[root@localhost doc]# find /usr/doc -name "k*" -print
/usr/doc/k3b~
/usr/doc/k3b

#find使用通配符的时候需要加引号,如果不加,FC将会提示:

[root@localhost doc]# find /usr/doc -name k* -print
#find: 路径必须在表达式之前
Usage: find [-H] [-L] [-P] [path...] [expression]

#还有一种解决方法:
[root@localhost doc]# find /usr/doc -name k\* -print
/usr/doc/k3b~
/usr/doc/k3b

#以上的解释在:
In this case the * is expanded by the shell.If the pattern matches a single filename in the current directory(such as mbar or mfram),the expanded name will be passed to find as a parameter.

2 关于快速搜索
#其实快速搜索就是细化路径,来较少时间和CPU的消耗。

[root@localhost doc]# find /usr/doc -name k3b -print

[root@localhost doc]# find / -name k3b -print

#可以比较出时间的差异。

3 文件创建时间搜索
[root@localhost doc]# echo aaa>tmp
[root@localhost doc]# ls tmp
tmp
[root@localhost doc]# find ./ -ctime 0
./
./tmp
#也就是搜索当天搜索的东西。注意目录的使用技巧。这个目录技巧最早我是在生成C程序的时候用到的。

[root@localhost doc]# find ./ -atime 0
./
./60.pdf
./FC5_help
./FC5_help/FC5_1_files
./aa
./nce2
./note
./nce1
./sx
./nce3
./bm
./nce4
./tmp
#以上是atime的结果,atime表示“读取过的”。
---------------------
其他参数没有特别说明,自行参考man。

标签:

posted by Klot @ 16:43:00  
0 Comments:
发表评论
<< Home
 
Creative Commons(CC)
About Me
Name: Klot
Email: fff200200#gmail.com
About Me:
Links
Powered by

Google Blogger

Stand Alone Complex by Klot