LinuxϵͳÈÕÖ¾¹¦Äܼ°Æä¹ÜÀíÏê½â
±ÈÌØÍøתÔØ£ºhttp://datacenter.chinabyte.com/308/11039308.shtml
ÈÕÖ¾¶ÔÓÚ°²È«À´Ëµ£¬·Ç³£ÖØÒª£¬Ëû¼Ç¼ÁËϵͳÿÌì·¢ÉúµÄ¸÷ÖÖ¸÷ÑùµÄÊÂÇ飬Äã¿ÉÒÔͨ¹ýËûÀ´¼ì²é´íÎó·¢ÉúµÄÔÒò£¬»òÕßÊܵ½¹¥»÷ʱ¹¥»÷ÕßÁôϵĺۼ£¡£ÈÕÖ¾Ö÷ÒªµÄ¹¦ÄÜÓУºÉó¼ÆºÍ¼à²â¡£Ëû»¹¿ÉÒÔʵʱµÄ¼à²âϵͳ״̬£¬¼à²âºÍ×·×ÙÇÖÈëÕߵȵȡ£
¡¡¡¡ÔÚLinuxϵͳÖУ¬ÓÐÈý¸öÖ÷ÒªµÄÈÕÖ¾×Óϵͳ£º
¡¡¡¡Á¬½Óʱ¼äÈÕÖ¾--Óɶà¸ö³ÌÐòÖ´ÐУ¬°Ñ¼Í¼дÈëµ½/var/log/wtmpºÍ/var/run/utmp£¬loginµÈ³ÌÐò¸üÐÂwtmpºÍutmpÎļþ£¬Ê¹ÏµÍ³¹ÜÀíÔ±Äܹ»¸ú×ÙËÔÚºÎʱµÇ¼µ½ÏµÍ³¡£
¡¡¡¡½ø³Ìͳ¼Æ--ÓÉϵͳÄÚºËÖ´ÐС£µ±Ò»¸ö½ø³ÌÖÕֹʱ£¬ÎªÃ¿¸ö½ø³ÌÍù½ø³Ìͳ¼ÆÎļþ£¨pacct»òacct£©ÖÐдһ¸ö¼Í¼¡£½ø³Ìͳ¼ÆµÄÄ¿µÄÊÇΪϵͳÖеĻù±¾·þÎñÌṩÃüÁîʹÓÃͳ¼Æ¡£
¡¡¡¡´íÎóÈÕÖ¾--ÓÉsyslogd£¨8£©Ö´ÐС£¸÷ÖÖϵͳÊØ»¤½ø³Ì¡¢Óû§³ÌÐòºÍÄÚºËͨ¹ýsyslog£¨3£©ÏòÎļþ/var/log/messages±¨¸æÖµµÃ×¢ÒâµÄʼþ¡£ÁíÍâÓÐÐí¶àUNIX³ÌÐò´´½¨ÈÕÖ¾¡£ÏñHTTPºÍFTPÕâÑùÌṩÍøÂç·þÎñµÄ·þÎñÆ÷Ò²±£³ÖÏêϸµÄÈÕÖ¾¡£
¡¡¡¡³£ÓõÄÈÕÖ¾ÎļþÈçÏ£º
¡¡¡¡access-log¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¼Í¼HTTP/webµÄ´«Êä
¡¡¡¡acct/pacct¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¼Í¼Óû§ÃüÁî
¡¡¡¡aculog¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¼Í¼MODEMµÄ»î¶¯
¡¡¡¡btmp¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¼Í¼ʧ°ÜµÄ¼Í¼
¡¡¡¡lastlog¡¡¡¡¼Í¼×î½ü¼¸´Î³É¹¦µÇ¼µÄʼþºÍ×îºóÒ»´Î²»³É¹¦µÄµÇ¼
¡¡¡¡messages¡¡¡¡¡¡¡¡´ÓsyslogÖмǼÐÅÏ¢£¨ÓеÄÁ´½Óµ½syslogÎļþ£©
¡¡¡¡sudolog¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¼Í¼ʹÓÃsudo·¢³öµÄÃüÁî
¡¡¡¡sulog¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¼Í¼ʹÓÃsuÃüÁîµÄʹÓÃ
¡¡¡¡syslog¡¡¡¡¡¡¡¡ ´ÓsyslogÖмǼÐÅÏ¢£¨Í¨³£Á´½Óµ½messagesÎļþ£©
¡¡¡¡utmp¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¼Í¼µ±Ç°µÇ¼µÄÿ¸öÓû§
¡¡¡¡wtmp¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ò»¸öÓû§Ã¿´ÎµÇ¼½øÈëºÍÍ˳öʱ¼äµÄÓÀ¾Ã¼Í¼
¡¡¡¡xferlog¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¼Í¼FTP»á»°
¡¡¡¡utmp¡¢wtmpºÍlastlogÈÕÖ¾ÎļþÊǶàÊýÖØÓÃUNIXÈÕÖ¾×ÓϵͳµÄ¹Ø¼ü--±£³ÖÓû§µÇ¼½øÈëºÍÍ˳öµÄ¼Í¼¡£Óйص±Ç°µÇ¼Óû§µÄÐÅÏ¢¼Ç¼ÔÚÎļþutmpÖУ»µÇ¼½øÈëºÍÍ˳ö¼Í¼ÔÚÎļþwtmpÖУ»×îºóÒ»´ÎµÇ¼Îļþ¿ÉÒÔÓÃlastlogÃüÁî²ì¿´¡£Êý¾Ý½»»»¡¢¹Ø»úºÍÖØÆðÒ²¼Ç¼ÔÚwtmpÎļþÖС£ËùÓеļͼ¶¼°üº¬Ê±¼ä´Á¡£ÕâЩÎļþ£¨lastlogͨ³£²»´ó£©ÔÚ¾ßÓдóÁ¿Óû§µÄϵͳÖÐÔö³¤Ê®·ÖѸËÙ¡£ÀýÈçwtmpÎļþ¿ÉÒÔÎÞÏÞÔö³¤£¬³ý·Ç¶¨ÆÚ½ØÈ¡¡£Ðí¶àϵͳÒÔÒ»Ìì»òÕßÒ»ÖÜΪµ¥Î»°ÑwtmpÅäÖóÉÑ
Ïà¹ØÎĵµ£º
1. ѧ»áд¼òµ¥µÄmakefile
2. ±àһЩӦÓÃ
³ÌÐò
£¬¿ÉÒÔÓÃmakefileÅÜÆðÀ´
3. ѧ»áдÇý¶¯
µÄmakefile
4. дһ¼òµ¥charÇý¶¯£¬makefile±àÒëͨ¹ý£¬¿ÉÒÔinsmod£¬ lsmod£¬ rmmod. ÔÚÇý¶¯µÄinitº¯ÊýÀï´òÓ¡hello world£¬insmodºóÓ¦¸ÃÄܹ»Í¨¹ýdmesg¿´µ½Êä³ö
¡£
5. дһÍêÕûÇý¶¯£¬ ¼ÓÉÏread£¬ write£¬ ioctl£¬ pollingµÈ¸ ......
gcc mousekey.c -lX11 -IX11
´ò¿ªmousekeysÔËÐÐ./a.out
¹Ø±ÕmousekeysÔËÐÐ./a.out 1,ÕâÀïÔÚa.outºóÃæËæ±ã¼ÓÒ»¸ö²ÎÊý¾Í¿ÉÒÔÁË£¬ÒòΪÅжÏÌõ¼þΪ if(argc < 2)
/*********source code***************/
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X ......
ÉèÖÃdsnºóËäÈ»ÐéÄâ»ú¿ÉÒÔÉÏÍøÁË£¬µ«ÊÇÓû§Ãû±ä³ÉÁËbogon£¬¶ø²»ÊÇ֮ǰµÄlocalhost£¬È¥µôDNSºóÖØÆôÐéÄâ»ú¾ÍÓÖ±ä³ÉÁËlocalhost
È»ºó¾Í¿ÉÒÔmount±¾»úÁË
»¹ÓÐÒ»ÖÖ·½·¨£º
hostname ÏÔʾµ±Ç°Ö÷»úÃû
hostname localhost ÉèÖõ±Ç°Ö÷»úÃûΪlocalhost
¹À¼ÆÒ²¿ÉÒÔ½â¾öÉÏÊö²»ÄÜmountµÄÎÊÌâ¡£ ......
Linux ÊÍ·ÅÄÚ´æ·½·¨
ÏÈ¿´¿´ÄÚ´æʹÓÃ×´¿ö
[root@node1 ~]# free -m
total used free shared buffers cached
Mem: 8004 6557 1446 0 163 5630
-/+ buffers/cache: 763 7240
Swap: 1983 0 1983
°ÑÄÚ´æÀïµÄÊý¾ÝÔÝʱдµ½Ó²ÅÌÀï
[root@node1 ~]# sync
ÐÞ¸Ä /proc/sys/vm/drop_cachesÎļþ
[root@node1 ~]# echo 3 > ......