linux ÖнâÎöÃüÁîÐвÎÊý £¨getopt_longÓ÷¨)
ÎÒÃÇÔÚlinuxÏÂÃæµÄ³ÌÐò¿ª·¢£¬ºÜ¶àʱºò¶¼»áÓöµ½ÃüÁîÐд¦Àí£¬ÃüÁîÐвÎÊý´¦ÀíÕâÑùÒ»ÖÖ¿ØÖÆ̨³ÌÐò£¬ËüÄܹ»ºÜÃ÷Á˵ĸøÓû§³ÌÐò³ö³ÌÐòµÄʹÓ÷½·¨£¬Ò²Äܹ»Ê¹ÎÒÃǵijÌÐò¿ª·¢µÄÁ÷³Ì±äµÃ¸ü¼ÓÃ÷ÁË¡£ÏÂÃæÎÒÃǾÍÒ»ÆðÀ´ÌÖÂÛһϣ¬ÎÒÃÇƽʱÈçºÎ´¦ÀíÕâÖÖÃüÁîµÄÊäÈë²ÎÊý£¬ÆäʵÕâ¸ö¾Í¸úreadlineµÄ´¦Àí²î²»¶à£¬ÎÒÃÇÈç¹ûÕÆÎÕÁËÕâÖÖ¹ÌÓеÄģʽ£¬ÄÇÄãÒÔºóÿ¸ö³ÌÐòÓÐÕâ·½ÃæµÄÐèÇ󶼿ÉÒÔÖ±½ÓÌ×ÓÃÁË£¬´ó´óÌá¸ßÁËÎÒÃǵĿª·¢Ð§ÂÊ¡£
Ò».ģʽ¿ò¼Ü½²½â
±¾ÏëÍêÕûµÄдһƪÎÄÕ£¬µ«·¢ÏÖÒ»ÊÇmanÊֲὲ½âÌ«ÏêϸÁË£¬»¹ÓкÜÏêϸµÄʵÀý£¬ÔÙ¾ÍÊǸù¾Ýman·Òë¹ýÀ´µÄ¸çÃÇÎÄÕÂÌ«¶à£¬¹ÊÕⲿ·ÖÄÚÈÝÎÒÒ²¾ÍÖ±½ÓתÔØÁËһλÍøÓѵIJ¿·Ö·Ò룬±¾²¿·ÖÄÚÈÝתÔØ×Ô£ºhttp://blog.csdn.net/ast_224/archive/2009/02/04/3861625.aspx
getopt_longÖ§³Ö³¤Ñ¡ÏîµÄÃüÁîÐнâÎö£¬Ê¹ÓÃman getopt_long£¬µÃµ½ÆäÉùÃ÷ÈçÏ£º
#include <getopt.h>
int getopt_long(int argc, char * const argv[],
const char *optstring,
const struct option *longopts, int *longindex);
int getopt_long_only(int argc, char * const argv[],
const char *optstring,
const struct option *longopts, int *longindex);
˵Ã÷£ºº¯ÊýÖеÄargcºÍargvͨ³£Ö±½Ó´Ómain()µ½Á½¸ö²ÎÊý´«µÝ¶øÀ´¡£optstingÊÇÑ¡Ïî²ÎÊý×é³ÉµÄ×Ö·û´®£¬Èç
¹û¸Ã×Ö·û´®ÀïÈÎÒ»×ÖĸºóÓÐðºÅ£¬ÄÇôÕâ¸öÑ¡Ïî¾ÍÒªÇóÓвÎÊý¡£ÏÂÒ»¸ö²ÎÊýÊÇÖ¸ÏòÊý×éµÄÖ¸Õ룬Õâ¸öÊý×éÊÇ
option½á¹¹Êý×飬option½á¹¹³ÆΪ³¤Ñ¡Ïî±í£¬ÆäÉùÃ÷ÈçÏ£º
struct option {
const char *name;
int has_arg;
int *flag;
int val;
};
½á¹¹ÖеÄÔªËؽâÊÍÈçÏ£º
const char *name£ºÑ¡ÏîÃû£¬Ç°ÃæûÓж̺áÏß¡£Æ©Èç"help"¡¢"verbose"Ö®Àà¡£
int has_arg£ºÃèÊö³¤Ñ¡ÏîÊÇ·ñÓÐÑ¡Ïî²ÎÊý£¬Èç¹ûÓУ¬ÊÇÄÄÖÖÀàÐ͵IJÎÊý£¬ÆäÖµ¼ûϱí:
·ûºÅ³£Á¿ &n
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
LinuxϵͳÃüÁî·ÖÀàÏê½â
Ò».±¸·ÝѹËõ
¶þ.Îļþ¹ÜÀí
Èý.ÍøÂçͨÐÅ
ËÄ.ÌØÊâÃüÁî
1.RPM ÃüÁîÊÖ²á
2.Linux ÖÐÎļþ²éÕÒ¼¼Êõ´óÈ«
3.FTP ÃüÁî´óÈ«¼°ÆäÓ¦ÓÃ
Îå.ϵͳ¹ÜÀí
Áù.ÆäËû
Ò».±¸·ÝѹËõ
zipinfo
¹¦ÄÜ˵Ã÷£ºÁгöѹËõÎļþÐÅÏ¢¡£
Óï ·¨£ºzipinfo [-12hlmMstTvz][ѹËõÎļþ][Îļþ...][-x ]
²¹³ä˵Ã÷£ºÖ´ÐÐzi ......
/etc/passwd ×¢£ºÓû§£¨user£©µÄÅäÖÃÎļþ£»
/etc/shadow ×¢£ºÓû§£¨user£©Ó°×Ó¿ÚÁîÎļþ£»
/etc/group ×¢£ºÓû§×飨group£©ÅäÖÃÎļþ£»
/etc/gshadow ×¢£ºÓû§×飨group£©µÄÓ°×ÓÎļþ£»
¹ÜÀíÓû§£¨user£©Ïà¹ØÃüÁî
useradd ×¢£ºÌí¼ÓÓû§
adduser ×¢£ºÌí¼ÓÓû§
passwd ×¢£ºÎªÓû§ÉèÖÃÃÜÂë
usermod ×¢£ºÐÞ¸ÄÓû§ÃüÁî£ ......
ÏÈ°ÑÖжϴ¦ÀíÁ÷³Ì¸ø³öÀ´
1.½øÈëÖжϴ¦Àí³ÌÐò--->2.±£´æ¹Ø¼üÉÏÏÂÎÄ---->3.¿ªÖжϣ¨stiÖ¸Á--->4.½øÈëÖжϴ¦Àí³ÌÐòµÄhandler--->5.¹ØÖжϣ¨cliÖ¸Á---->6.дEOI¼Ä´æÆ÷£¨±íʾÖжϴ¦ÀíÍê³É£©---->7.¿ªÖжϡ£
Ó²Öжϣº
¶ÔÓ¦ÓÚÉÏͼµÄ1¡¢2¡¢3²½Ö裬ÔÚÕ⼸¸ö²½ÖèÖУ¬ËùÓÐÖжÏÊDZ»ÆÁ±ÎµÄ£¬Èç¹ûÔÚÕâ¸öʱºò˯ ......