LINUXÆÚÄ©¸´Ï° Îļþ´¦Àí
Ò»¡¢LINUXÎļþ½á¹¹ ¢ÙÎļþ
Ϊ²Ù×÷ϵͳ·þÎñ¡¢É豸·ÃÎÊÌṩÁ˼òµ¥¶øͳһµÄ½Ó¿Ú¡£ÎļþÊý¾Ý½á¹¹°üÀ¨ÎļþÃû×Ö¡¢´´½¨ÈÕÆÚ¡¢·ÃÎÊȨ¡¢Îļþ³¤¶ÈµÈ£¬ÕâЩÊý¾Ý¶¼±£´æÔÚÎÒÃdzÆ֮Ϊ ½Úµã ÖС£
¢ÚÉ豸
Ó²¼þÔÚLINUX/UNIXÖÐͨ³£ÊDZ»Ó³Éä³ÉÎļþµÄ£¬ÕâÔÚǶÈëʽµ±ÖÐÊÇÊ®·ÖÖØÒªµÄ¡£
¼¸¸öÖØÒªµÄÉ豸Îļþ£º
one: /dev/console ´ú±íµÄÊÇϵͳ¿ØÖÆ̨¡£
two: /dev/tty Êǽø³Ì¿ØÖÆÖնˡ£
three: /dev/null ¿ÕÉ豸¡£
¢ÛĿ¼
Ò»ÖÖ±£´æ½ÚµãºÅºÍÆäËûÎļþÃû×ÖµÄÌØÊâÎļþ,ͨ³£Ö»ÄÜÍϹýopendir ºÍ readdirÀ´²Ù×÷¡£ ¶þ¡¢ÏµÍ³µ÷Óà ¶¨Ò壺¶ÔÎļþºÍÉ豸½øÐзÃÎʺͿØÖƵĺ¯Êýµ÷Óñ»³ÆΪϵͳµ÷Óã¬ËüÓÐLINUXÖ±½ÓÌṩ£¬ÊÇͨÏò²Ù×÷ϵͳ±¾ÉíµÄ²Ù×÷½Ó¿Ú¡£
²»×㣺ϵͳµ÷ÓûήµÍ¼ÆËã»úµÄÖ´ÐÐÐÔÄÜ¡£ÒòΪÓû§¿Õ¼äºÍÄں˿ռ䴦ÓÚ²»Í¬µÄ¿Õ¼ä£¬ÏµÍ³µ÷ÓûáÔÚÓû§³ÌÐòºÍÄں˴úÂëÖ®¼äÀ´»ØÇл»£¬ÏµÍ³¿ªÏúºÜ´ó¡£Ò»°ãÓɿ⺯ÊýÀ´¼ä½Óµ÷Óᣠ¢Ùopen
¾ÙÀý£ºfile = open("stu.info ", O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);
˵Ã÷£º O_RDWR£ºÒÔ¶Áд·½Ê½´ò¿ªÎļþ¡£
O_CREAT£º°´modeÖиøµÄ·ÃÎÊģʽ´´½¨Îļþ¡£
S_IRUSR£ºÎļþµÄÊôÖ÷Óû§ÓжÁȨÏÞ
S_IWUSR£ºÎļþµÄÊôÖ÷Óû§ÓÐдȨÏÞ ¢Úclose
¾ÙÀý£ºclose(¾ßÌåµÄÎļþÃèÊö·û); ¢Ûread
¾ÙÀý1£º
char bud[20];
printf(¡°The value read returned %d .\n¡±,res=read(0,buf,20));//±ê×¼ÊäÈë
buf[res]=¡¯\0¡¯;
printf(¡°%s¡±,buf);
¾ÙÀý2£º
typedef struct
{
char stu_num[12];
char name[10];
short int sex;//for 0 is female ,1 is male
char mobile_phone[12];
} stu_info;
read(file,&record,sizeof(record)); ¢Üwrite
¾ÙÀý1£º
if(write(1,¡±hellloworld\n¡±,sizeof(¡°hellloworld\n¡±)) != sizeof(¡°hellloworld\n¡±))
printf(¡°Error!¡±);//±ê×¼Êä³ö
¾ÙÀý2£º
write(file,&record,sizeof(record)); ¢Ýioctl(ǶÈëʽLINUX¶ÔÉ豸µÄÅäÖÃ)
¢Þlseek
¢ßĿ¼Ïà¹Øº¯Êý
Ë
Ïà¹ØÎĵµ£º
Ò»¡¢GCC (×î×î³£¼û:gcc hello.c –o hello) ¢Ù³£ÓÃÑ¡Ïî -c:½ö¶ÔÔ´Îļþ½øÐбàÒë
-o:¶ÔÉú³ÉµÄ´úÂë½øÐÐÓÅ»¯£¬ÓÐ0£¬1£¬2£¬3ËĸöµÈ¼¶£¬Ä¬ÈÏΪ2
-g:¼ÓÈëµ÷ÊÔÐÅÏ¢
-I dir:±àÒëÔ´ÎļþÊÇÔö¼ÓÒ»¸öËÑË÷¿âÎļþµÄĿ¼
-w:½ûÖ¹ËùÓо¯¸æ
-W warning:ÔÊÐí ......
¼¶±ð£º ³õ¼¶
·¶Ïþ¾æ (xiaoju_f@263.net), ÁªÏë(±±¾©)ÓÐÏÞ¹«Ë¾Èí¼þÉè¼ÆÖÐÐÄǶÈëʽÑз¢´¦¿ª·¢¹¤³Ìʦ, ÁªÏë(±±¾©)ÓÐÏÞ¹«Ë¾Èí¼þÉè¼ÆÖÐÐÄ
2003 Äê 8 ÔÂ 11 ÈÕ
¶ÔÓÚÒÆÖ² linux µ½ÆäËü¿ª·¢°åµÄÈËÀ´Ëµ£¬±àд boot loader ÊÇÒ»¸ö²»¿É±ÜÃâµÄ¹ý³Ì¡£¶ÔÓÚѧϰlinuxµÄÈËÀ´½²£¬±àд bootloader Ò²ÊÇÒ»¸öºÜÓÐÌôÕ½ÐԵŤ×÷¡£±¾ÎÄͨ¹ý¶Ô li ......
°æȨÉùÃ÷
±¾ÎÄ×÷ÕßÊÇһλ×ÔÓÉÈí¼þ°®ºÃÕߣ¬ËùÒÔ±¾ÎÄËäÈ»²»ÊÇÈí¼þ£¬µ«ÊDZ¾×Å GPL µÄ¾«Éñ·¢²¼¡£ÈκÎÈ˶¼¿ÉÒÔ×ÔÓÉʹÓá¢×ªÔØ¡¢¸´ÖƺÍÔÙ·Ö·¢£¬µ«±ØÐë±£Áô×÷ÕßÊðÃû£¬Ò಻µÃ¶ÔÉùÃ÷ÖеÄÈκÎÌõ¿î×÷ÈκÎÐÎʽµÄÐ޸ģ¬Ò²²»µÃ¸½¼ÓÈκÎÆäËüÌõ¼þ¡£Äú¿ÉÒÔ×ÔÓÉÁ´½Ó¡¢ÏÂÔØ¡¢´«²¥´ËÎĵµ£¬µ«Ç°ÌáÊDZØÐ뱣֤ȫÎÄÍêÕûתÔØ£¬°üÀ¨ÍêÕûµÄ°æȨÐÅÏ¢ºÍ× ......
0 ÒýÑÔ
΢´¦ÀíÆ÷µÄ²úÉúΪ¼Û¸ñµÍÁ®¡¢½á¹¹Ð¡ÇɵÄCPUºÍÍâÉèµÄÁ¬
½ÓÌṩÁËÎȶ¨¿É¿¿µÄÓ²¼þ¼Ü¹¹£¬ÕâÑù£¬ÏÞÖÆǶÈëʽϵͳ·¢Õ¹µÄÆ¿¾±¾ÍÍ»³ö±íÏÖÔÚÁËÈí¼þ·½Ãæ¡£¾¡¹Ü´Ó°ËÊ®Äê´úÄ©¿ªÊ¼£¬ÒѾ½Ðø³öÏÖÁËһЩǶÈëʽ²Ù×÷ϵͳ(±È½ÏÖø
ÃûµÄÓÐVxwork¡¢pSOS¡¢NeculeusºÍWindows
CE)¡£µ«ÕâЩרÓòÙ×÷ϵͳ¶¼ÊÇÉÌ ......
ÒªÔÚ¹¤×÷Õ¾ÏÔʾÎļþ£¬ÇëÊäÈ룺
cat notes
´ËÃüÁî»áÏÔʾ notes ÎļþÖеÄÊý¾Ý¡£Èç¹û¸ÃÎļþµÄÐÐÊý´óÓÚ¿ÉÓÃÆÁÄ»ÐÐÊý¼õÒ»µÄÖµ£¬ÔòÎļþµÄ²¿·ÖÄÚÈÝ»á¹ö³öÆÁÄ»¡£ÒªÃ¿´Î½«ÎļþÁÐÔÚÒ»Ò³ÉÏ£¬Ê¹Óà pg ÃüÁî¡£
Òª²¢Öü¸¸öÎļþ£¬ÇëÊäÈ룺
cat section1.1 section1.2 section1.3 >section1
´ËÃüÁ ......