Linux Find ÃüÁָͨÄÏ
Linux Find ÃüÁָͨÄÏ
×÷ÕߣºSheryl Calish
¼òµ¥½éÉÜÕâÒ»ÎÞ´¦²»ÔÚµÄÃüÁîµÄÇ¿´óµÄ·½ÃæÒÔ¼°»ìÂҵķ½Ãæ¡£
2008 Äê 7 Ô·¢²¼
Linux find ÃüÁîÊÇËùÓÐ Linux ÃüÁîÖÐ×îÓÐÓõÄÒ»¸ö£¬Í¬Ê±Ò²ÊÇ×î»ìÂÒµÄÒ»¸ö¡£ËüºÜÄÑ£¬ÒòΪËüµÄÓï·¨ÓëÆäËû Linux ÃüÁîµÄ±ê×¼Óï·¨²»Í¬¡£µ«ÊÇ£¬ËüºÜÇ¿´ó£¬ÒòΪËüÔÊÐíÄú°´ÎļþÃû¡¢ÎļþÀàÐÍ¡¢Óû§ÉõÖÁÊÇʱ¼ä´Á²éÕÒÎļþ¡£Ê¹Óà find ÃüÁÄú²»µ«¿ÉÒÔÕÒµ½¾ßÕâЩÊôÐÔÈÎÒâ×éºÏµÄÎļþ£¬»¹¿ÉÒÔ¶ÔËüÕÒµ½µÄÎļþÖ´ÐвÙ×÷¡£
±¾ÎĵÄÄ¿µÄÊÇ£¬Í¨¹ý¸ÅÊö find ÃüÁîµÄÓÃ;ºÍDZÄÜ£¬¼ò»¯¸ÃÃüÁîµÄѧϰºÍʹÓá£Í¬Ê±£¬Ëü½«Õë¶Ô find ÃüÁîµÄijЩ×îÇ¿´óµ«×î»ìÂҵķ½ÃæÌṩһ¸ö»ù±¾µÄÖ¸ÄϺͲο¼¡£
[×¢Ò⣺±¾ÎÄʹÓÃµÄ find °æ±¾ÊÇ GNU °æ±¾£¬Òò´Ë£¬Ä³Ð©Ï¸½Ú¿ÉÄÜÓëÆäËû°æ±¾µÄ find ÓÐËù²»Í¬¡£]
»ù±¾¸ñʽ
¿ªÊ¼Ö®Ç°£¬ÎÒÃÇÏÈÀ´¿´Ò»Ï find ÃüÁîµÄ»ù±¾½á¹¹£º
find start_directory test options criteria_to_match
action_to_perform_on_results
ÔÚÒÔÏÂÃüÁîÖУ¬find ½«¿ªÊ¼ÔÚµ±Ç°Ä¿Â¼£¨ÓÓ.”±íʾ£©ÖвéÕÒÈκÎÀ©Õ¹ÃûΪ“java”µÄÎļþ£º
find . -name "*.java"
ÏÂÃæÊǸÃÃüÁîËùÕÒµ½µÄÃüÁîµÄËõÂÔÇåµ¥£º
find . -name "*.java"
./REGEXPvalidate/src/oracle/otnsamples/plsql/ConnectionManager.java
./REGEXPvalidate/src/oracle/otnsamples/plsql/DBManager.java
..
[×¢Ò⣺Èç¹ûÄú´Ó±¾ÎļôÇв¢Õ³ÌùÀ´ÔËÐиà find ÃüÁÄú¿ÉÄÜÐèҪʹÓÃ×Ô¼ºµÄ¼üÅÌÌ滻˫ÒýºÅ (“”) ²ÅÄܵóöÕýÈ·µÄ½á¹û¡£]
ÒÔÏÂÃüÁִÐÐÏàͬµÄ²Ù×÷¡£ÔÚÕâÁ½ÖÖÇé¿öÏ£¬Äú¶¼ÐèÒª¶ÔͨÅä·û½øÐÐתÒåÒÔÈ·±£Ëü´«µÝµ½ find ÃüÁî²¢ÇÒ²»ÓÉ shell ½âÊÍ¡£Òò´Ë£¬Ç뽫ÄúµÄËÑË÷×Ö·û´®·Åµ½ÒýºÅÀ»òÕßÔÚËüÇ°Ãæ¼ÓÉÏ·´Ð±Ïߣº
find . -name \*.java
¾¡¹Ü find µÄËùÓвÎÊý¾ùΪ¿ÉÑ¡£¬µ«ÊÇÈç¹ûÄúδָ¶¨´ÓÄÄÀ↑ʼËÑË÷£¬ËÑË÷ĬÈϽ«ÔÚµ±Ç°Ä¿Â¼ÖпªÊ¼¡£Èç¹ûÄú²»Ö¸¶¨ÒªÆ¥ÅäµÄ²âÊÔÁ¬½Ó¡¢Ñ¡Ïî»òÖµ£¬ÄúµÄ½á¹û½«²»ÍêÕû»òÕßÎÞÇø±ð¡£
ÔËÐÐÒÔÏÂÈý¸ö find ÃüÁµÃ³öͬÑùµÄ½á¹û — µ±Ç°Ä¿Â¼ºÍËùÓÐ×ÓĿ¼ÖеÄËùÓÐÎļþ£¨°üÀ¨Òþ²ØÎļþ£©µÄÍêÕûÇåµ¥£º
find
find .
find . -print
ÕâÀàËÆÓÚÔËÐÐÒ»¸ö´ø -la Ñ¡ÏîµÄ ls ÃüÁî¡£Èç¹ûÄúÏ£ÍûÉÏÊöÃüÁîµÄÊä³ö°üº¬ÍêÕûµÄ·¾¶Ã
Ïà¹ØÎĵµ£º
´´½¨×ÀÃæͼ±ê
Ä¿Ç°½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËƵķ½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......
ÎÒÕâÀï˵µÄioctlº¯ÊýÊÇÔÚÇý¶¯³ÌÐòÀïµÄ£¬ÒòΪÎÒ²»ÖªµÀ»¹ÓÐûÓбðµÄ³¡ºÏÓõ½ÁËioctl£¬ ËùÒԾ͹涨ÁËÎÒÃÇÌÖÂ۵ķ¶Î§¡£ÎªÊ²Ã´ÒªÐ´ÆªÎÄÕÂÄØ£¬ÊÇÒòΪÎÒÇ°Ò»Õó×Ó±»ioctl¸ø¸ã»ìÁË£¬Õ⼸Ìì²ÅŪÃ÷°×Ëü£¬ÓÚÊÇÔÚÕâÀïÇåÀíÒ»ÏÂÍ·ÄÔ¡£
Ò»¡¢ ʲôÊÇioctl¡£
ioctlÊÇÉ豸Çý¶¯³ÌÐòÖжÔÉ豸µÄI/OͨµÀ½øÐйÜÀíµÄº¯Êý¡£Ëùν¶ÔI/OͨµÀ½øÐйÜÀí£ ......
1.»ù´¡ÖªÊ¶
Ò»¸ö²Ù×÷ϵͳ¿ÉÒÔ¼òµ¥µÄ³éÏóΪ£¬Òýµ¼³ÌÐò ÄÚºË Îļþϵͳ¡£
vmlinuzÊÇLinux Äں˵ľµÏñÎļþ,¿ÉÒÔ±»Òýµ¼³ÌÐò¼ÓÔØ,´Ó¶øÆô¶¯Linuxϵͳ¡£
initrdµÄÈ«³ÆÊÇboot loader initialized RAM disk£¬ËüÊÇϵͳÆô¶¯Ê±ËùʹÓõĸùÎļþϵͳӳÏñÎļþ£¬Õâ¸öÎļþϵͳÖаüº¬¼¸¸öÇý¶¯Ä£¿é£¬ÓÃÀ´×°ÔØʵ¼ÊµÄ¸ùÎļþϵͳ£¬±ÈÈçÒ»¸öIDE»òS ......
/************************
cÓïÑÔ±àдµÄtcp socketͨÐŵÄserver¶Ë¡£
¿ÉÒÔ³ÖÐø¼àÌýmyprotÖ¸¶¨µÄ¶Ë¿Ú
´òÓ¡¶Ë¿Ú½ÓÊÕµ½µÄ×Ö·ûÁ÷
Í·ÎļþÒòΪ¼âÀ¨ºÅ±»×ªÒ壬ËùÒÔÓÃÁËÒýºÅ
************************/
#include "stdio.h"
#include "stdlib.h"
#include "errno.h"
#include "string.h& ......
LinuxµÄ±äÁ¿¿É·ÖΪÁ½Àࣺ»·¾³±äÁ¿ºÍ±¾µØ±äÁ¿
»·¾³±äÁ¿£¬»òÕß³ÆΪȫ¾Ö±äÁ¿£¬´æÔÚÓëËùÓеÄshellÖУ¬ÔÚÄãµÇ½ϵͳµÄʱºò¾ÍÒѾÓÐÁËÏàÓ¦µÄϵͳ¶¨ÒåµÄ»·¾³±äÁ¿ÁË¡£LinuxµÄ»·¾³±äÁ¿¾ßÓм̳ÐÐÔ£¬¼´×Óshell»á¼Ì³Ð¸¸shellµÄ»·¾³±äÁ¿¡£
±¾µØ±äÁ¿£¬µ±Ç°shellÖеıäÁ¿£¬ºÜÏÔÈ»±¾µØ±äÁ¿Öп϶¨°üº¬»·¾³±äÁ¿¡£LinuxµÄ±¾µØ±äÁ¿µÄ·Ç»·¾³± ......