0. ǰÑÔ
µµ°¸ËÑѰ£¬¶ÔÓÚÒ»¸öÐÂϵͳÀ´Ëµ£¬¿ÉÄÜûÓкܴóµÄÓÃ;£»
µ«ÊǶÔÓÚÒ»¸ö¾Éϵͳ£¬µµ°¸¼°ÎļþÔ½À´Ô½¶à£¬ Õâʱ¾Í±ØÐëÒªÓÃËÑѰÀ´ÕÒѰµµ°¸ÁË¡£
1.which
Ö¸Áî : which £¨ locate a program file in the user's path £©
Óï·¨ : which program
ÓÃ; : ´ÓʹÓÃÕßµÄÖ´Ðз¾¶£¬Ñ°ÕÒÖ´ÐÐÎļþ¡£
ʵÀý : ËÑѰ cd µÄλÖá£
2.whereis Ö¸Áî : whereis £¨ locate programs £©
Óï·¨ : whereis [ -bms ] program
ÓÃ; : ѰÕÒÔʼ³ÌÐòÊý¾Ý¼Ð (source directory), ¶þ½øÖƳÌÐò (binary). ʹÓÃÊÖ²á (manuals)
²ÎÊý : -b ËÑѰ¶þ½øÖƳÌÐò £» -m ËÑѰʹÓÃÕßÊÖ²á £» -s ËÑѰÔʼ³ÌÐòµÄÊý¾Ý¼Ð
ʵÀý :
(1) ËÑѰ cd ʹÓÃÕßÊÖ²áµÄλÖá£
( 2) ËÑѰ cd Ö´ÐÐÎļþµÄλÖá£
˵Ã÷ : Èô²»¼ÓÈκβÎÊý£¬Ôò±íʾ -bms ¶¼ÓС£ ʵÀýÖгöÏÖ¾¯¸æÑ¶Ï¢ÄËÊÇÒòÅÝÅÝδ°²×° X-window µÄ¹ØÏµ¡£
3.find
Ö¸Áî : find £¨ walk a file hierarchy £©
Óï·¨ : find ÆðʼĿ¼ -name ÓûÕÒµÄÎļþÃû -print
ÓÃ; : ÔÚµµ°¸ÏµÍ³¼Ü¹¹ÖÐËÑѰ¡£
ʵÀý : ÔÚĿǰĿ¼ÖУ¬ËÑѰÃûΪ test µÄµµ°¸¡£
4.grep Ö¸Áî : grep £¨ print lines matching a pattern £©
Óï·¨ : grep pattern file_name
ÓÃ; : ËÑѰµµ°¸ÄÚÈÝÖк¬ÓÐ pattern µÄÐС£
ʵÀý : ËÑѰµµ°¸ test ÖУ¬°üº¬ panda µÄÐС£
ÏÈÏÔʾµµ°¸ÄÚÈÝ£º
5.locate
Ö¸Áî : locate £¨ find filenames quickly £©
Óï·¨ : locate program/file
ÓÃ; : ´Óϵͳ½¨Á¢µÄÊý¾Ý¿âÖÐËÑѰµµ°¸¼°Êý¾Ý¼Ð¡£
ʵÀý : ´ÓÊý¾Ý¿âÖÐËÑѰ test µµ°¸¡£
Ã÷ : /var/db/locate.database Ô¤ÉèµÄ locate Êý¾Ý¿â£º /usr/libexec/locate.updatedb
¸üРlocate Êý¾Ý¿âµÄ script µµ°¸¡£ /etc/periodic/weekly/310.locate ¶¨Ê±¸üÐÂÖØ½¨ locate Êý¾Ý¿âµÄ script µµ°¸¡£
²¹³ä : Òò locate Ô¤Éèÿһ¸öÐÇÆÚ²Å¸üÐÂÒ»´ÎÊý¾Ý¿â£¬ËùÒÔн¨Á¢µÄµµ°¸²»»á³öÏÖ¡£ µ«ÊÇËüµÄÊý¾ÝÏÔʾÁ¿ÊÇ×î¶àµÄà¸
ºÙºÙ£¬ÕâÊÇһƪºÃµÄ×ÊÁÏÎÄÕ£¬µ«ÊÇͼƬÔÚÔÀ´µÄÎÄÕµØÁ´½ÓÒѾ»µÁË¡£
Ö»ÄÜ´Õ»òÕß¿´ÁË¡£