LinuxÐÔÄܵ÷ÓÅ
¸ÅÊö
1. “/etc/profile”Îļþ
2. “bdflush”²ÎÊý
3. “ip_local_port_range”²ÎÊý
4. “/etc/nsswitch.conf”Îļþ
5. “/proc”Îļþϵͳ
6. “ulimit”²ÎÊý
7. Ôö¼Óϵͳ´ò¿ªµÄÎļþÊýÄ¿
8. Îļþ“atime”ÊôÐÔ
9. ÎļþµÄ“noatime”ÊôÐÔ
10. Ìض¨µÄTCP/IPÕ»
11. ½»»»·ÖÇø
12. µ÷ÕûIDEÓ²ÅÌÐÔÄÜ
¸ÅÊö
ÓÅ»¯ÍøÂçÐÔÄÜÔںܴó³Ì¶ÈÉÏÓëÍøÂçÉÏʹÓõÄÈíÓ²¼þÏà¹Ø¡£ÈçºÎÓÅ»¯ÍøÂçÊǺÜÄÑÓÃÒ»±¾Êé˵µÃÇå³þµÄ¡£ÔÚÍøÂçÕæÕýÔËÐÐÆðÀ´Ö®Ç°ÊǺÜÄÑÖªµÀÍøÂçµÄÆ¿¾±ËùÔÚ¡£ÐÔÄÜÓÅ»¯²¢²»ÊǺܼòµ¥ºÍÖ±¹ÛµÄ£¬±ØÐëµ±×÷Ò»¸öºÜ¸´ÔÓµÄÈÎÎñ¡£¶øÇÒ£¬²»½öÊܵ½ºÜ¶àÔ¼Êø»¹ÐèÒªºÜ¸ßµÄ¾«È·¶È¡£³ý·Ç½øÐÐרÃŵIJâÊÔÒÔÕï¶ÏϵͳÖеÄÆ¿¾±£¬·ñÔò¶ÔһЩÏÖÏóºÜÄÑ×ö³ö½âÊÍ¡£ÓÐʱ£¬ÐÔÄÜÓÅ»¯»á±ä³ÉÒ»ÏîÈÃÈËÊ®·ÖʧÍû²¢ÇÒ·¦Î¶µÄ¹¤×÷£¬ÓÈÆäÊÇÔÚ¾¹ý´óÁ¿µÄ·ÖÎöÖ®ºóËùµÃµ½µÄ½á¹ûÈÔÈ»²»¿ÉÈ·¶¨µÄʱºò¡£µ«ÊÇ£¬¶ÔϵͳÐÔÄܵÄÓÅ»¯ÊÇÒ»ÏîºÜÓлر¨µÄ¹¤×÷£¬²¢ÇÒ»á¸øÕû¸öϵͳ´øÀ´³¤ÆÚµÄÒæ´¦¡£
1. “/etc/profile”Îļþ
“etc/profile”Îļþº¬ÓÐϵͳ´óÁ¿µÄ»·¾³ºÍÆô¶¯³ÌÐòµÄÅäÖÃÐÅÏ¢¡£ÄãÔÚ¸ÃÎļþÖнøÐеÄÅäÖ㬿ÉÒÔͨ¹ýÉêÇëÈ«¾Ö»·¾³±äÁ¿À´ÊµÏÖ¡£Òò´Ë£¬ÔÚ¸ÃÎļþÖÐÉèÖÃÓÅ»¯±êÖ¾£¬ÊÇÒ»ÖÖÃ÷ÖǵÄÑ¡Ôñ¡£ÒªÏëʹx86³ÌÐò»ñµÃ×î¼ÑÐÔÄÜ£¬¿ÉÒÔÔÚ±àÒëʱ£¬Ê¹ÓÃ×î¼ÑµÄÓÅ»¯Ñ¡Ïî-O9 ¡£Ðí¶à³ÌÐòµÄ“Makefile”ÎļþÖÐÒѾº¬ÓÐ-O2Ñ¡Ï¶ø-O9ʹ±àÒëÆ÷²ÉÓÃ×î¸ß¼¶±ðµÄÓÅ»¯¡£¾¡¹ÜËü½«Ôö¼Ó×îÖÕ³ÌÐòµÄ´óС£¬µ«ÕâÑù¿ÉÒÔ»ñµÃ¸ü¸ßµÄÔËÐÐËٶȡ£±àÒëʱ£¬Ê¹ÓÓ-fomit-frame-pointer”Ñ¡Ï³ÌÐòÔËÐÐʱ£¬·ÃÎʱäÁ¿Ê±½«Ê¹ÓöÑÕ»¡£µ«ÊÇ£¬Ê¹ÓÃÕâһѡÏÉú²úµÄ´úÂ뽫ÎÞ·¨µ÷ÊÔ¡£Ê¹ÓÓ-mcpu=cpu_type”ºÍ“-march=cpu_type”Ñ¡ÏGcc½«Õë¶ÔÕâÖÖÐͺÅCPU½øÐÐרÃŵÄÓÅ»¯£¬µ«Éú³ÉµÄ´úÂëÖ»ÄÜÔÚËùÖ¸¶¨µÄCPU»ò¸ü¸ßϵÁеÄCPUÉÏÔËÐС£
¶ÔÓÚCPU i686»òPentiumPro¡¢Pentium II¡¢Pentium III
ÔÚ“/etc/profile”ÎļþÖÐ , ¼ÓÈëÒ»ÐУº
CFLAGS=’-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro -march=pentiumpro -fomit-
frame-pointer -fno-exceptions’
¶ÔÓÚCPU i586»òPentium
ÔÚ“etc/profile”ÎļþÖÐ, ¼ÓÈëÒ»ÐУº
CFLAGS=’-O3 -march=pentium -mcpu=pentium -ffast-math -funroll-loops -fomit-frame-pointer -fforce-
mem -fforce-addr -
Ïà¹ØÎĵµ£º
1
¸ùÎļþϵͳ
¼òµ¥À´Ëµ£¬£¨¸ùÎļþϵͳ£©¾ÍÊÇϵͳµÚÒ»¸ö
mount
µÄÎļþϵͳ
Filesystem
Handling
Like
every
traditional
Unix
system,
Linux
makes
use
of
a
system ......
ÔÚ
linux
ϵͳÖУ¬
TCP/IP
ÍøÂçÊÇͨ¹ýÈô¸É¸öÎı¾Îļþ½øÐÐÅäÖõģ¬ÐèÒª±à¼ÕâЩÎļþÀ´Íê³ÉÁªÍø¹¤×÷¡£ÏµÍ³ÖÐÖØÒªµÄÓйØÍøÂçÅäÖÃÎļþΪ£º
¡ô
/etc/sysconfig/network
¡ô
/etc/HOSTNAME
¡ô
/etc/hosts
¡ô
/etc/services
¡ô
/etc/host.conf
¡ô
/etc/nsswitch.conf
¡ô
/etc/resolv.conf
¡ô
/etc/r ......
linuxÉϵļ¸¸ö·Å¿ÉÖ´ÐÐÎļþµÄĿ¼ÓÐʲô²»Í¬£¿
/bin: programs used in booting the system
/usr/bin:   ......
Linux µÄ×Ö·û´®½ØÈ¡ºÜÓÐÓá£ÓаËÖÖ·½·¨¡£
¼ÙÉèÓбäÁ¿ var=http://www.hao.com/123.htm
.
.
Ò» # ºÅ½ØÈ¡£¬É¾³ý×ó±ß×Ö·û£¬±£ÁôÓÒ±ß×Ö·û¡£
echo ${var#*//}
ÆäÖÐ var ÊDZäÁ¿Ãû£¬# ºÅÊÇÔËËã·û£¬*// ±íʾ´Ó×ó±ß¿ªÊ¼É¾³ýµÚÒ»¸ö // ºÅ¼°×ó±ßµÄËùÓÐ×Ö·û
¼´É¾³ý http://
½á¹ûÊÇ £ºwww.hao.com/123.htm
.
.
¶ ......
´´½¨Ð½ø³Ì£ºforkº¯Êý
1.1.1. forkº¯Êý¸Éʲô£¿
#include <sys/types.h>
#include <unistd.h>
pid_t fork(void);
‘fork()’º¯ÊýÓÃÓÚ´ÓÒÑ´æÔÚ½ø³ÌÖд´½¨Ò»¸öнø³Ì¡£Ð½ø³Ì³ÆΪ×Ó½ ......