linuxÖÐgrepÃüÁîÏê½â
ÔÚlinuxÖÐgrepÃüÁîÊǷdz£ÓÐÓõÄ,ËüºÍ¹ÜµÀ(|)ÅäºÏʹÓÃ,·Ç³£Ç¿´ó,ÓÃÓÚËÑË÷Îı¾Îļþ.Èç¹ûÏëÒªÔÚ¼¸¸öÎı¾ÎļþÖвéÕÒÒ»×Ö·û´®£¬¿ÉÒÔʹÓÃ
‘grep’ÃüÁî¡£‘grep’ÔÚÎı¾ÖÐËÑË÷Ö¸¶¨µÄ×Ö·û´®¡£
¼ÙÉèÄúÕýÔÚ‘/usr/src/linux/Documentation’Ŀ¼ÏÂËÑË÷´ø×Ö·û´®‘magic’µÄÎļþ£º
$ grep magic /usr/src/linux/Documentation/*
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
µ±È»£¬Èç¹ûÔ¤Áϵ½ÓÐÐí¶àÊä³ö£¬Äú¿ÉÒÔͨ¹ý ¹ÜµÀ ½«Æäתµ½‘less’ÉÏÔĶÁ£º
$ grep magic /usr/src/linux/Documentation/* | less
ÕâÑù£¬Äú¾Í¿ÉÒÔ¸ü·½±ãµØÔĶÁ¡£
ÓÐÒ»µãҪעÒ⣬Äú±ØÐèÌṩһ¸öÎļþ¹ýÂË·½Ê½£¨ËÑË÷È«²¿ÎļþµÄ»°ÓÃ
*£©¡£Èç¹ûÄúÍüÁË£¬‘grep’»áÒ»Ö±µÈ×Å£¬Ö±µ½¸Ã³ÌÐò±»Öжϡ£Èç¹ûÄúÓöµ½ÁËÕâÑùµÄÇé¿ö£¬°´ <CTRL c> £¬È»ºóÔÙÊÔ¡£
ÏÂÃæÊÇһЩÓÐÒâ˼µÄÃüÁîÐвÎÊý£º
grep -i pattern files £º²»Çø·Ö´óСдµØËÑË÷¡£Ä¬ÈÏÇé¿öÇø·Ö´óСд£¬
grep -l pattern files £ºÖ»ÁгöÆ¥ÅäµÄÎļþÃû£¬
grep -L pattern files £ºÁгö²»Æ¥ÅäµÄÎļþÃû£¬
grep -w pattern files £ºÖ»Æ¥ÅäÕû¸öµ¥´Ê£¬¶ø²»ÊÇ×Ö·û´®µÄÒ»²¿·Ö£¨ÈçÆ¥Åä‘magic’£¬¶ø²»ÊÇ‘magical’£©£¬
grep -C number pattern files £ºÆ¥ÅäµÄÉÏÏÂÎÄ·Ö±ðÏÔʾ[number]ÐУ¬
grep pattern1 | pattern2 files £ºÏÔʾƥÅä pattern1 »ò pattern2 µÄÐУ¬
grep pattern1 files | grep pattern2 £ºÏÔʾ¼ÈÆ¥Åä pattern1 ÓÖÆ¥Åä pattern2 µÄÐС£
ÕâÀﻹÓÐЩÓÃÓÚËÑË÷µÄÌØÊâ·ûºÅ£º
\< ºÍ \> ·Ö±ð±ê×¢µ¥´ÊµÄ¿ªÊ¼Óë½áβ¡£
ÀýÈ磺
grep man * »áÆ¥Åä ‘Batman’¡¢‘manic’¡¢‘man’µÈ£¬
grep '\<man' * Æ¥Åä‘manic’ºÍ‘man’£¬µ«²»ÊÇ‘Batman’£¬
grep '\<man\>' ֻƥÅä‘man’£¬¶ø²»ÊÇ‘Batman&rs
Ïà¹ØÎĵµ£º
fg¡¢bg¡¢jobs¡¢&¡¢ctrl + z¶¼ÊǸúϵͳÈÎÎñÓйصģ¬ËäÈ»ÏÖÔÚ»ù±¾Éϲ»ÔõôÐèÒªÓõ½ÕâЩÃüÁµ«Ñ§»áÁËÒ²ÊǺÜʵÓõÄ
Ò»¡£& ×î¾³£±»Óõ½
Õâ¸öÓÃÔÚÒ»¸öÃüÁîµÄ×îºó£¬¿ÉÒÔ°ÑÕâ¸öÃüÁî·Åµ½ºǫִ́ÐÐ
¶þ¡£ctrl + z
¿ÉÒÔ½«Ò»¸öÕýÔÚǰִ̨ÐеÄÃüÁî·Åµ½ºǫ́£¬²¢ÇÒÔÝÍ£
Èý¡£jobs
²é¿´µ±Ç°ÓжàÉÙÔÚºǫ́ÔËÐеÄÃüÁî
ËÄ¡£fg
......
2.1 LinuxÄÚºËģʽ
µ¥ÄÚºËģʽµÄÄں˿ÉÒÔ´ÖÂԵķÖΪÈý¸ö²ã´Î£ºµ÷Ó÷þÎñµÄÖ÷³ÌÐò²ã¡¢Ö´ÐÐϵͳµ÷ÓõķþÎñ²ãºÍÖ§³Öϵͳµ÷Óõĵײ㺯Êý¡£
2.2 LinuxÄÚºËÌåϵ½á¹¹
LinuxÄÚºËÓÉÎå¸öÄ£¿é×é³É£º½ø³Ìµ÷¶ÈÄ£¿é¡¢ÄÚ´æ¹ÜÀíÄ£¿é¡¢Îļþϵͳģ¿é¡¢½ø³Ì¼äͨР......
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
¹È¸èºÜÅ£Æø£¬¸ù±¾²»Àí»á
Linux
Äں˿ª·¢ÍŶӣ¬½á¹û±»³ýÃû¡£¿É±¯Ò²£¡
2
ÔÂ
3
ÈÕ£¬
Linux
Äں˿ª·¢Õß
Greg
Kroah-Hartman
½«
Android
µÄÇý¶¯³ÌÐò´ ......
¹¦ÄÜ£º
¼ÓÔØÖ¸¶¨µÄÎļþϵͳ¡£
Óï·¨£º
mount [-afFhnrvVw] [-L] [-o] [-t] [É豸Ãû] [¼ÓÔصã]
Ó÷¨ËµÃ÷£º
mount¿É½«Ö¸¶¨É豸ÖÐÖ¸¶¨µÄÎļþϵͳ¼ÓÔص½LinuxĿ¼Ï£¨Ò²¾ÍÊÇ×°Ôص㣩¡£¿É½«¾³£Ê¹ÓõÄÉ豸дÈë
Îļþ/etc/fastab,ÒÔʹϵͳÔÚÿ´ÎÆô¶¯Ê±×Ô¶¯¼ÓÔØ¡£mount¼ÓÔØÉ豸µÄÐÅÏ¢¼Ç¼ÔÚ/etc/mtabÎļþÖС£Ê¹ÓÃumountÃüÁîÐ ......
1.·ÖÇøÓë¸ñʽ»¯ÔÀí
Ó²Å̵ķÖÇø·ÖÖ÷MBR£¨446byte£©,Ö÷·ÖÇø±í(64byte)£¬·ÖÇø.
2.ʹÓÃlinuxÖеÄfdisk·ÖÇø
fdisk /dev/sdb
p ´òÓ¡·ÖÇø±í
t ת»»·ÖÇø±í
w д½ø·ÖÇø±í
n н¨·ÖÇø
v ¼ì²é·ÖÇø
×¢£ºfdiskʹÓÃÍêÒªÖØÐÂÆô¶¯.ÐÂÓ²Å̲»ÓÃ.
3.linuxµÄ¸ñʽ»¯Èí¼þ
mkfs-Ö§³Öext2,ext3,vfat,msdos,jfs,reiserfsµÈ
Ó÷¨1£ºmkfs ......