Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux grepÃüÁǿ´óµÄÎı¾ËÑË÷

Ô­ÎÄ http://www.9usb.net/200902/linux-grep.html
1.×÷ÓÃ
linuxϵͳÖÐgrepÃüÁîÊÇÒ»ÖÖÇ¿´óµÄÎı¾ËÑË÷¹¤¾ß£¬ËüÄÜʹÓÃÕýÔò±í´ïʽËÑË÷Îı¾£¬²¢°ÑÆ¥ÅäµÄÐдòÓ¡³öÀ´¡£grepÈ«³ÆÊÇGlobal Regular Expression Print£¬±íʾȫ¾ÖÕýÔò±í´ïʽ°æ±¾£¬ËüµÄʹÓÃȨÏÞÊÇËùÓÐÓû§¡£
2.¸ñʽ
grep [options]
3.Ö÷Òª²ÎÊý
[options]Ö÷Òª²ÎÊý£º
£­c£ºÖ»Êä³öÆ¥ÅäÐеļÆÊý¡£
£­I£º²»Çø·Ö´óСд(Ö»ÊÊÓÃÓÚµ¥×Ö·û)¡£
£­h£º²éѯ¶àÎļþʱ²»ÏÔʾÎļþÃû¡£
£­l£º²éѯ¶àÎļþʱֻÊä³ö°üº¬Æ¥Åä×Ö·ûµÄÎļþÃû¡£
£­n£ºÏÔʾƥÅäÐм°Ðкš£
£­s£º²»ÏÔʾ²»´æÔÚ»òÎÞÆ¥ÅäÎı¾µÄ´íÎóÐÅÏ¢¡£
£­v£ºÏÔʾ²»°üº¬Æ¥ÅäÎı¾µÄËùÓÐÐС£
patternÕýÔò±í´ïʽÖ÷Òª²ÎÊý£º
\£ººöÂÔÕýÔò±í´ïʽÖÐÌØÊâ×Ö·ûµÄÔ­Óк¬Òå¡£
^£ºÆ¥ÅäÕýÔò±í´ïʽµÄ¿ªÊ¼ÐС£
$: Æ¥ÅäÕýÔò±í´ïʽµÄ½áÊøÐС£
\<£º´ÓÆ¥ÅäÕýÔò±í´ïʽµÄÐпªÊ¼¡£
\>£ºµ½Æ¥ÅäÕýÔò±í´ïʽµÄÐнáÊø¡£
[ ]£ºµ¥¸ö×Ö·û£¬Èç[A]¼´A·ûºÏÒªÇó ¡£
[ - ]£º·¶Î§£¬Èç[A-Z]£¬¼´A¡¢B¡¢CÒ»Ö±µ½Z¶¼·ûºÏÒªÇó ¡£
¡££ºËùÓеĵ¥¸ö×Ö·û¡£
* £ºÓÐ×Ö·û£¬³¤¶È¿ÉÒÔΪ0¡£
4.grepÃüÁîʹÓüòµ¥ÊµÀý
$ grep ‘test’ d*
ÏÔʾËùÓÐÒÔd¿ªÍ·µÄÎļþÖаüº¬testµÄÐС£
$ grep ‘test’ aa bb cc
ÏÔʾÔÚaa£¬bb£¬ccÎļþÖÐÆ¥ÅätestµÄÐС£
$ grep ‘[a-z]\{5\}’ aa
ÏÔʾËùÓаüº¬Ã¿¸ö×Ö·û´®ÖÁÉÙÓÐ5¸öÁ¬ÐøСд×Ö·ûµÄ×Ö·û´®µÄÐС£
$ grep ‘w\(es\)t.*\1′ aa
Èç¹ûwest±»Æ¥Å䣬Ôòes¾Í±»´æ´¢µ½ÄÚ´æÖУ¬²¢±ê¼ÇΪ1£¬È»ºóËÑË÷ÈÎÒâ¸ö×Ö·û(.*)£¬ÕâЩ×Ö·ûºóÃæ½ô¸ú×ÅÁíÍâÒ»¸öes(\1)£¬ÕÒµ½¾ÍÏÔʾ¸ÃÐС£Èç¹ûÓÃegrep»ògrep -E£¬¾Í²»ÓÔ\”ºÅ½øÐÐתÒ壬ֱ½Óд³É’w(es)t.*\1′¾Í¿ÉÒÔÁË¡£
5.grepÃüÁîʹÓø´ÔÓʵÀý
¼ÙÉèÄúÕýÔÚ’/usr/src/linux/Doc’Ŀ¼ÏÂËÑË÷´ø×Ö·û´®’magic’µÄÎļþ£º
$ grep magic /usr/src/linux/Doc/*
sysrq.txt:* How do I enable the magic SysRQ key?
sysrq.txt:* How do I use the magic SysRQ key?
ÆäÖÐÎļþ’sysrp.txt’°üº¬¸Ã×Ö·û´®£¬ÌÖÂÛµÄÊÇ SysRQ µÄ¹¦ÄÜ¡£
ĬÈÏÇé¿öÏ£¬’grep’Ö»ËÑË÷µ±Ç°Ä¿Â¼¡£Èç¹û´ËĿ¼ÏÂÓÐÐí¶à×ÓĿ¼£¬’grep’»áÒÔÈçÏÂÐÎʽÁгö£º
grep: sound: Is a directory
Õâ¿ÉÄÜ»áʹ’grep’µÄÊä³öÄÑÓÚÔĶÁ¡£ÕâÀïÓÐÁ½ÖÖ½â¾öµÄ°ì·¨£º
Ã÷È·ÒªÇóËÑË÷×ÓĿ¼£ºgrep -r
»òºöÂÔ×ÓĿ¼£ºgrep -d skip
Èç¹ûÓкܶàÊä³ö


Ïà¹ØÎĵµ£º

Linux 2.6 ×Ö·ûÉ豸Çý¶¯³ÌÐò

¡ð
¡¢ËµÃ÷
±Ê¼ÇÊÊÓÃÓÚ
Linux
µÄ
2.6.10
ÒÔºóµÄÄںˡ£
±Ê¼ÇÒÔ
Linux
Device
Driver3
ÌṩµÄ
scull
³ÌÐò
(scull
Ŀ¼ÖеÄ
main.c
ºÍ
scull.h)
Ϊ¼Ç¼Ö÷Ïߣ¬²¢ÒÔ¸ÃÇý¶¯³ÌÐòÖеĸ÷ÖÖϵͳµ÷Óúͺ¯Êýµ÷ÓÃÁ÷³ÌΪ¼Ç
¼˳Ðò¡£±ÈÈ磬
module_init( )
ºÍ
module_exit(
)
ΪÏà¶ÔÓ¦µÄÒ»¶Ôϵͳµ÷Óã¬Ò»°ãÊé¼®Öж ......

LINUX Ï°²×°TFTP·þÎñ

TFTPÊÇÓÃÀ´ÏÂÔØÔ¶³ÌÎļþµÄ×î¼òµ¥ÍøÂçЭÒ飬Ëü»ùÓÚUDPЭÒé¶øʵÏÖ¡£Ç¶ÈëʽlinuxµÄtftp¿ª·¢»·¾³°üÀ¨Á½¸ö·½Ã棺һÊÇǶÈëʽlinuxËÞÖ÷»úµÄ tftp-serverÖ§³Ö£¬¶þÊÇǶÈëʽlinuxÄ¿±ê»úµÄtftp-clientÖ§³Ö¡£ÒòΪu-boot±¾ÉíÄÚÖÃÖ§³Ötftp-client£¬ËùÒÔǶÈëʽĿ±ê»ú¾Í²»ÓÃÅäÖÃÁË¡£ÏÂÃæ¾ÍÏêϸ½éÉÜÒ»ÏÂlinuxËÞÖ÷»útftp-serverµÄ°²×°ÅäÖá£
......

LinuxÏ´´½¨Óë½âѹzip, tar, tar.gzºÍtar.bz2Îļþ


ÔÚLinuxÏÂÃæȥѹËõÎļþ»òÕßĿ¼¡£ÎÒÃǽ«Ñ§Ï°zip, tar, tar.gzºÍtar.bz2µÈѹËõ¸ñʽµÄ»ù±¾Ó÷¨¡£
zip¸ñʽÒѳÉΪѹËõÎļþµÄ±ê׼ѡÔñ£¬¶øÇÒËüÔÚwindowsÉÏÒ²ÄÜʹÓá£
¾­³£ÓÃzip¸ñʽѹËõÄÇЩÐèÒª¹²Ïí¸øwindowsÓû§µÄÎļþ¡£
Èç¹ûÖ»Êǹ²Ïí¸ølinuxÓû§»òÕßMacÓû§£¬Æ«ÏòÓÚÑ¡Ôñtar.gz¸ñʽ¡£
ZIP
zip¿ÉÄÜÊÇĿǰʹÓõÃ×î¶àµÄÎĵµ ......

LinuxÏÂÈí¼þ¡¢PHPºÍPerlµÄÄ£¿éµÈ¶¼ÊµÏÖÁË×Ô¶¯°²×°

LinuxÏÂÈí¼þ¡¢PHPºÍPerlµÄÄ£¿éµÈ¶¼ÊµÏÖÁË×Ô¶¯°²×°£¬ÕæµÄºÜ·½±ã£¬±¾Îļòµ¥½éÉÜһϡ£
linuxÏ¿ÉÒÔʹÓÃyum¹¤¾ß£¬RedhatÏÂ×Ô¶¯´øÓУº
yum list php*   //¿ÉÒԲ鿴phpµÄÏà¹ØÄ£¿é
yum install php //°²×°phpÕâ¸öÄ£¿é
phpÄ£¿éµÄ×Ô¶¯°²×°(ÀûÓÃpecl.php.netºÍpear.php.netÔÚÏß°²×°)£º
ÀûÓÃpearºÍpecl¹¤¾ß£¬Ê×ÏÈÐèÒª° ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ