LinuxÄں˵Äioctlº¯Êýѧϰ
ÎÒÕâÀï˵µÄioctlº¯ÊýÊÇÔÚÇý¶¯³ÌÐòÀïµÄ£¬ÒòΪÎÒ²»ÖªµÀ»¹ÓÐûÓбðµÄ³¡ºÏÓõ½ÁËioctl£¬ ËùÒԾ͹涨ÁËÎÒÃÇÌÖÂ۵ķ¶Î§¡£ÎªÊ²Ã´ÒªÐ´ÆªÎÄÕÂÄØ£¬ÊÇÒòΪÎÒÇ°Ò»Õó×Ó±»ioctl¸ø¸ã»ìÁË£¬Õ⼸Ìì²ÅŪÃ÷°×Ëü£¬ÓÚÊÇÔÚÕâÀïÇåÀíÒ»ÏÂÍ·ÄÔ¡£
Ò»¡¢ ʲôÊÇioctl¡£
ioctlÊÇÉ豸Çý¶¯³ÌÐòÖжÔÉ豸µÄI/OͨµÀ½øÐйÜÀíµÄº¯Êý¡£Ëùν¶ÔI/OͨµÀ½øÐйÜÀí£¬¾ÍÊǶÔÉ豸µÄһЩÌØÐÔ½øÐпØÖÆ£¬ÀýÈç´®¿ÚµÄ´«Ê䲨ÌØÂÊ¡¢Âí´ïµÄתËٵȵȡ£ËüµÄµ÷ÓøöÊýÈçÏ£º
int ioctl(int fd, ind cmd, …)£»
ÆäÖÐfd¾ÍÊÇÓû§³ÌÐò´ò¿ªÉ豸ʱʹÓÃopenº¯Êý·µ»ØµÄÎļþ±êʾ·û£¬cmd¾ÍÊÇÓû§³ÌÐò¶ÔÉ豸µÄ¿ØÖÆÃüÁÖÁÓÚºóÃæµÄÊ¡ÂԺţ¬ÄÇÊÇһЩ²¹³ä²ÎÊý£¬Ò»°ã×î¶àÒ»¸ö£¬ÓлòûÓÐÊǺÍcmdµÄÒâÒåÏà¹ØµÄ¡£
ioctlº¯ÊýÊÇÎļþ½á¹¹ÖеÄÒ»¸öÊôÐÔ·ÖÁ¿£¬¾ÍÊÇ˵Èç¹ûÄãµÄÇý¶¯³ÌÐòÌṩÁ˶ÔioctlµÄÖ§³Ö£¬Óû§¾Í¿ÉÒÔÔÚÓû§³ÌÐòÖÐʹÓÃioctlº¯Êý¿ØÖÆÉ豸µÄI/OͨµÀ¡£
¶þ¡¢ ioctlµÄ±ØÒªÐÔ
Èç¹û²»ÓÃioctlµÄ»°£¬Ò²¿ÉÒÔʵÏÖ¶ÔÉ豸I/OͨµÀµÄ¿ØÖÆ£¬µ«ÄǾÍÊÇÂùÅ¡ÁË¡£ÀýÈ磬ÎÒÃÇ¿ÉÒÔÔÚÇý¶¯³ÌÐòÖÐʵÏÖwriteµÄʱºò¼ì²éÒ»ÏÂÊÇ·ñÓÐÌØÊâ Ô¼¶¨µÄÊý¾ÝÁ÷ͨ¹ý£¬Èç¹ûÓеĻ°£¬ÄÇôºóÃæ¾Í¸ú×Å¿ØÖÆÃüÁһ°ãÔÚsocket±à³ÌÖг£³£ÕâÑù×ö£©¡£µ«ÊÇÈç¹ûÕâÑù×öµÄ»°£¬»áµ¼Ö´úÂë·Ö¹¤²»Ã÷£¬³ÌÐò½á¹¹»ì ÂÒ£¬³ÌÐòÔ±×Ô¼ºÒ²»áÍ·»èÑÛ»¨µÄ¡£
ËùÒÔ£¬ÎÒÃǾÍʹÓÃioctlÀ´ÊµÏÖ¿ØÖƵŦÄÜ¡£Òª¼Çס£¬Óû§³ÌÐòËù×÷µÄÖ»ÊÇͨ¹ýÃüÁîÂë¸æËßÇý¶¯³ÌÐòËüÏë×öʲô£¬ÖÁÓÚÔõô½âÊÍÕâЩÃüÁîºÍÔõôʵÏÖÕâЩÃüÁÕⶼÊÇÇý¶¯³ÌÐòÒª×öµÄÊÂÇé¡£
Èý¡¢ ioctlÈçºÎʵÏÖ
ÕâÊÇÒ»¸öºÜÂé·³µÄÎÊÌ⣬ÎÒÊÇÄÜÊ¡ÔòÊ¡¡£ÒªËµÇå³þËü£¬Ã»ÓÐËÄÎåǧ×ÖÊDz»Ðеģ¬ËùÒÔÎÒÕâÀïÊDz»¿ÉÄÜ°ÑËü˵µÃ·Ç³£Çå³þÁË£¬²»¹ýÈç¹ûÓжÁÕ߶ÔÓû§³ÌÐòÔõôºÍ Çý¶¯³ÌÐòÁªÏµÆðÀ´¸ÐÐËȤµÄ»°£¬¿ÉÒÔ¿´ÎÒÇ°Ò»Õó×ÓдµÄ¡¶writeµÄ°ÂÃØ¡·¡£¶ÁÕßÖ»Òª°Ñwrite»»³Éioctl£¬¾ÍÖªµÀÓû§³ÌÐòµÄioctlÊÇÔõôºÍÇý¶¯ ³ÌÐòÖеÄioctlʵÏÖÁªÏµÔÚÒ»ÆðµÄÁË¡£
ÎÒÕâÀï˵һ¸ö´ó¸Å˼·£¬ÒòΪÎÒ¾õµÃ¡¶LinuxÉ豸Çý¶¯³ÌÐò¡·Õâ±¾ÊéÒѾ˵µÄ·Ç³£Çå³þÁË£¬µ«Êǵû¯Ò»Ð©Ê±¼äÀ´¿´¡£
ÔÚÇý¶¯³ÌÐòÖÐʵÏÖµÄioctlº¯ÊýÌåÄÚ£¬Êµ¼ÊÉÏÊÇÓÐÒ»¸öswitch{case}½á¹¹£¬Ã¿Ò»¸öcase¶ÔÓ¦Ò»¸öÃüÁîÂ룬×ö³öһЩÏàÓ¦µÄ²Ù×÷¡£Ôõôʵ ÏÖÕâЩ²Ù×÷£¬ÕâÊÇÿһ¸ö³ÌÐòÔ±×Ô¼ºµÄÊÂÇ飬ÒòΪÉ豸¶¼ÊÇÌض¨µÄ£¬ÕâÀïҲû·¨Ëµ¡£¹Ø¼üÔÚÓÚÔõôÑù×éÖ¯ÃüÁîÂ룬ÒòΪÔÚioctlÖÐÃüÁîÂëÊÇΨһÁªÏµÓû§³ÌÐòÃü ÁîºÍÇý¶¯³ÌÐòÖ§³ÖµÄ;¾¶¡£
ÃüÁîÂëµÄ×éÖ¯ÊÇÓÐһЩ½²¾¿µÄ£¬ÒòΪÎÒÃÇÒ»¶¨Òª×öµ½ÃüÁîºÍÉ豸ÊÇÒ»Ò»¶ÔÓ¦µÄ£¬
Ïà¹ØÎĵµ£º
ÓÉÓÚÎҵĻúÆ÷ż¶û¿ª·¢Óã¬ËùÒÔ¿â±È½ÏÈ«¡£
ËùÒÔÈç¹ûÄú°²×°µÄʱºò£¬È±É¶²¹É¶°É~~
careone ´òdeb°ü~~
ÏÂÔØÒ³Ã棺http://forum.ubuntu.org.cn/viewtopic.php?f=137&t=217474
ÏÂÔصØÖ·£ºhttp://forum.ubuntu.org.cn/download/file.php?id=73080 ......
Ò»¡¢¶ÔÎļþµÄ½éÉܺͲÙ×÷
1) Linux ϵͳµÄÎļþ ºÍĿ¼ ¶¼ÓÐÈýÖÖ·ÃÎÊȨÏÞ·Ö±ðΪ£º¶Áread(r),write(w),execute(x)
2) linux ÎļþÓû§ÓÐÈýÖÖ£ºÎļþËùÓÐÕßuser£¬group£¬ÆäËüÈËothers
3)& ......
±¾ÈËʹÓõÄTDµÄÄ£¿éÊÇLC63**,ÔÚÉϸöÔµÄÕ⼸Ìì¸ÕÄõ½°å×Ó£¬ÕÛÌÚÁ˽«½üÒ»¸öÔ£¬Õâ¸ö°å×Ó´òµç»°£¬ÉÏÍø¶¼Ã»ÓÐÎÊÌâÁË¡£
Ê×ÏÈ»¹ÊÇÓбØÒª½éÉÜÒ»ÏÂpppÐÒéÁË£¬ÊÇTDÉÏÍøµÄ»ù´¡£º
PPPÊǵã¶ÔµãµÄÁ¬½ÓÐÒé¡£ÕâÖÖÁ¬½Ó½¨Á¢Ö®ºó£¬½«¸øÁ½µã·Ö±ð·ÖÅäIPµØÖ·£¬Ê¹ÓÃÕâ¸öIP¿ÉÒÔ½øÐÐÁ½µãÖ®¼äµÄͨѶ¡£»¥ÁªÍø×î³õµÄ“²¦ºÅÉÏÍø”·½Ê½Ëµµ ......
linuxÈçºÎϵͳÐÅÏ¢
Äõ½Ò»¸öϵͳ£¬¿Ï¶¨Òª¿´¿´ÏµÍ³ÅäÖã¬linuxÏ¿´ÅäÖ㬿ÉûÓÐwindowsÄÇôֱ¹Û¡£ÄãÖ»ÄÜÒ»¸öÒ»¸ö²é¿´¡£
Ò»£ºcpu
[root@srv /]# more /proc/cpuinfo | grep "model name"
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
model name &n ......
http://hugege.com/2009/06/24/linux-ssh/
Linux SSHÃüÁî´óÈ«
rm
-rf mydir /* ɾ³ýmydirĿ¼ */
cd mydir /* ½øÈëmydirĿ¼ */
cd – /*
»ØÉÏÒ»¼¶Ä¿Â¼ */
cd ~ /* »Ø¸ùĿ¼ */
mv tools tool /* °ÑtoolsĿ¼¸ÄÃûΪtool */
ln -s tool bac
/*
¸øtoolĿ¼´´½¨ÃûΪbacµÄ·ûºÅÁ´½Ó,×îÊìϤµÄÓ¦¸Ã¾ÍÊÇFTP ......