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

linuxÌí¼Ó·ÓÉ

linuxÌí¼Ó·ÓÉ
http://baikgd.blog.163.com/blog/static/35402495200972111353827/
·þÎñÆ÷ip(eth0)
[root@localhost net]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:E3:9A:15
inet addr:172.18.3.205 Bcast:172.18.3.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee3:9a15/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4776 errors:0 dropped:0 overruns:0 frame:0
TX packets:3348 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:439384 (429.0 KiB) TX bytes:390425 (381.2 KiB)
Interrupt:11 Base address:0x1400
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:254 errors:0 dropped:0 overruns:0 frame:0
TX packets:254 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:22128 (21.6 KiB) TX bytes:22128 (21.6 KiB)
²é¿´Ô­Ê¼Â·ÓÉÐÅÏ¢
[root@localhost net]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.18.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
==========================================================
Ìí¼ÓĬÈÏÍø¹Ø
[root@localhost net]# route add default gw 172.18.3.50
[root@localhost net]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.18.3.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 172.18.3.50 0.0.0.0 UG 0 0 0 eth0
=======================================================
Ìí¼ÓÒ»¸öip(eth0:1)
[root@localhost net]# ifconfig eth0:1 192.168.168.119 netmask 255.255.255.0 up
[root@localhost net]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:E3:9A:15
inet addr:172.18.3.205 Bcast:172.18.3.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee3:9a15/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5071 errors:0 dropped:0 overruns:0 frame:0
TX packets:3569 errors:0 dropped:0 overrun


Ïà¹ØÎĵµ£º

ÿÈÕC(3.Linux³£ÓÃCº¯Êý ÄÚ´æ¿ØÖÆƪ)

ÄÚ´æ¿ØÖÆƪ
calloc
free
getpagesize
malloc
mmap
munmap
calloc£¨ÅäÖÃÄÚ´æ¿Õ¼ä£©
Ïà¹Øº¯Êý
malloc£¬free£¬realloc£¬brk
±íÍ·Îļþ
#include <stdlib.h>
¶¨Ò庯Êý
void *calloc(size_t nmemb£¬size_t size);
º¯Êý˵Ã÷
calloc()ÓÃÀ´ÅäÖÃnmemb¸öÏàÁÚµÄÄڴ浥λ£¬Ã¿Ò»µ¥Î»µÄ´óСΪsize£¬²¢·µ»ØÖ¸ÏòµÚ ......

Linuxƽ̨É϶¯Ì¬Á´½Ó¿âµÄ´´½¨Óë¼ÓÔØ

        ÔÚ¶Ájvm´úÂëʱ£¬Ñ§Ï°Á˶ÁÈ¡¶¯Ì¬Á´½Ó¿âµÄ·½·¨¡£ÏÂÃæ¾Í.soÎļþµÄ´´½¨ºÍ¶ÁÈ¡×öÒ»¸ö¼òµ¥µÄ×ܽᡣ
1.´´½¨.soÎļþ
add.h
 #ifndef ADD_H
#define ADD_H
int add(int arg1,int arg2);
#endif

add.c
#include "add.h"
int add(int arg1,int arg2)
{
return ......

Linux¡¢FreeBSD¡¢OpenBSD¡¢OpenSolarisÂÒÕ½

ÔÚ×ÀÃæ²Ù×÷ϵͳÁìÓò£¬WindowsºÍMac
OS¢¶Ïמø´ó²¿·ÖÊг¡£¬Linux¡¢BSDµÈÆäËû¸÷ÖÖϵͳֻÄÜÆ«°²Ò»Ó磬²»¹ýËüÃǵķ¢Ðа汾ȴÊÇÏ൱·á¸»£¬³ýÁË×î³£¼ûµÄUbuntuÖ®Í⻹ÓÐ
Fedora¡¢Debian¡¢FreeBSD¡¢OpenBSD¡¢OpenSolarisµÈµÈ£¬½ñÌìÎÒÃǾ͵¥´ÓÐÔÄܽǶȱȽÏÒ»ÏÂÕâЩ²»Í¬°æ±¾¡£
¡¡¡¡²Î²â¶ÔÏó(¾ùΪ64λ°æ±¾)£º
¡¡¡¡£­ Fedora 12£ºÊ ......

Linux±Ê¼Ç


linuxĿ¼¼Ü¹¹
/   ¸ùĿ¼
/bin    ³£ÓõÄÃüÁî
binary file µÄÄ¿錄
/boot   ´æ·ÅϵͳÆô¶¯Ê±±ØÐë¶ÁÈ¡µÄµµ°¸£¬°üÀ¨ºËÐÄ
(kernel) ÔÚÄÚ
     /boot/grub/menu.lst   GRUBÉèÖÃ
     /boot/vmlinuz   ÄÚºË
  ......

linuxÃüÁîÐм¼ÇÉ

ÏÈд¼¸Ìõ£¬×Ô¼º³£Óõģ¬ÒÔºóÔÙ²¹³ä£º
1. ALT + '.'
Ç°Ò»ÌõÃüÁîµÄ×îºóÒ»¸ö²ÎÊý¡£
ÀýÈ磺
µÚÒ»ÌõÃüÁls /usr/loca/£»
µÚ¶þÌõÃüÁcd /usr/local;
µÚ¶þÌõÃüÁîµÄ/usr/local£¬Ö±½Óͨ¹ýALT+'.'¼´¿ÉÊäÈë¡£
2.CTRL+'r'
ÔÚhistoryÖÐÑ°ÕÒÃüÁî
3.TAB
²¹ÆëÎļþÃû»òĿ¼Ãû
4.$ find -name '*.[ch]' | xargs grep -E 'expr' ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ