Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : linux

Linux C ²Î¿¼ÊÖ²á Ö® »·¾³±äÁ¿Æª

getenv£¨È¡µÃ»·¾³±äÁ¿ÄÚÈÝ£©
Ïà¹Øº¯Êý putenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include<stdlib.h>
¶¨Ò庯Êý char * getenv(const char *name);
º¯Êý˵Ã÷ getenv()ÓÃÀ´È¡µÃ²ÎÊýname»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýnameΪ»·¾³±äÁ¿µÄÃû³Æ£¬Èç¹û¸Ã±äÁ¿´æÔÚÔò»á·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õë¡£»·¾³±äÁ¿µÄ¸ñʽΪname£½value¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õ룬ÕÒ²»µ½·ûºÏµÄ»·¾³±äÁ¿Ãû³ÆÔò·µ»ØNULL¡£
·¶Àý #include<stdlib.h>
mian()
{
char *p;
if((p = getenv(“USER”)))
printf(“USER=%s\n”,p);
}
Ö´ÐÐ USER = root
¡¡
putenv£¨¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿£©
Ïà¹Øº¯Êý getenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include4<stdlib.h>
¶¨Ò庯Êý int putenv(const char * string);
º¯Êý˵Ã÷ putenv()ÓÃÀ´¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýstringµÄ¸ñʽΪname£½value£¬Èç¹û¸Ã»·¾³±äÁ¿Ô­ÏÈ´æÔÚ£¬Ôò±äÁ¿ÄÚÈÝ»áÒÀ²ÎÊýstring¸Ä±ä£¬·ñÔò´Ë²ÎÊýÄÚÈÝ»á³ÉΪеĻ·¾³±äÁ¿¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»Ø0£¬ÓдíÎó·¢ÉúÔò·µ»Ø-1¡£
´íÎó´úÂë ENOMEM ÄÚ´æ²»×㣬ÎÞ·¨ÅäÖÃеĻ·¾³±äÁ¿¿Õ¼ä¡£
·¶Àý #include<stdlib.h>
main()
{
char *p;
if((p = getenv(&ld ......

Linux C ²Î¿¼ÊÖ²á Ö® »·¾³±äÁ¿Æª

getenv£¨È¡µÃ»·¾³±äÁ¿ÄÚÈÝ£©
Ïà¹Øº¯Êý putenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include<stdlib.h>
¶¨Ò庯Êý char * getenv(const char *name);
º¯Êý˵Ã÷ getenv()ÓÃÀ´È¡µÃ²ÎÊýname»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýnameΪ»·¾³±äÁ¿µÄÃû³Æ£¬Èç¹û¸Ã±äÁ¿´æÔÚÔò»á·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õë¡£»·¾³±äÁ¿µÄ¸ñʽΪname£½value¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õ룬ÕÒ²»µ½·ûºÏµÄ»·¾³±äÁ¿Ãû³ÆÔò·µ»ØNULL¡£
·¶Àý #include<stdlib.h>
mian()
{
char *p;
if((p = getenv(“USER”)))
printf(“USER=%s\n”,p);
}
Ö´ÐÐ USER = root
¡¡
putenv£¨¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿£©
Ïà¹Øº¯Êý getenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include4<stdlib.h>
¶¨Ò庯Êý int putenv(const char * string);
º¯Êý˵Ã÷ putenv()ÓÃÀ´¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýstringµÄ¸ñʽΪname£½value£¬Èç¹û¸Ã»·¾³±äÁ¿Ô­ÏÈ´æÔÚ£¬Ôò±äÁ¿ÄÚÈÝ»áÒÀ²ÎÊýstring¸Ä±ä£¬·ñÔò´Ë²ÎÊýÄÚÈÝ»á³ÉΪеĻ·¾³±äÁ¿¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»Ø0£¬ÓдíÎó·¢ÉúÔò·µ»Ø-1¡£
´íÎó´úÂë ENOMEM ÄÚ´æ²»×㣬ÎÞ·¨ÅäÖÃеĻ·¾³±äÁ¿¿Õ¼ä¡£
·¶Àý #include<stdlib.h>
main()
{
char *p;
if((p = getenv(&ld ......

linuxÏÂ×Ö·û±àÂëת»»

linuxÏÂ×Ö·û±àÂëת»»
Ò»¡¢ÀûÓÃiconvº¯Êý×å½øÐбàÂëת»»
iconvº¯Êý×åµÄÍ·ÎļþÊÇiconv.h,ʹÓÃÇ°Ðè°üº¬Ö®¡£
#include <iconv.h>
iconvº¯Êý×åÓÐÈý¸öº¯Êý,Ô­ÐÍÈçÏÂ:
(1) iconv_t iconv_open(const char *tocode, const char *fromcode);
´Ëº¯Êý˵Ã÷½«Òª½øÐÐÄÄÁ½ÖÖ±àÂëµÄת»»,tocodeÊÇÄ¿±ê±àÂë,fromcodeÊÇÔ­±àÂë,¸Ãº¯Êý·µ»ØÒ»¸öת»»¾ä±ú,¹©ÒÔÏÂÁ½¸öº¯ÊýʹÓá£
(2) size_t iconv(iconv_t cd,char **inbuf,size_t *inbytesleft,char **outbuf,size_t *outbytesleft);
´Ëº¯Êý´ÓinbufÖжÁÈ¡×Ö·û,ת»»ºóÊä³öµ½outbufÖÐ,inbytesleftÓÃÒԼǼ»¹Î´×ª»»µÄ×Ö·ûÊý,outbytesleftÓÃÒԼǼÊä³ö»º³åµÄÊ£Óà¿Õ¼ä£¬cdÊÇiconv_open·µ»ØµÄ¾ä±ú¡£ (3) int iconv_close(iconv_t cd);
´Ëº¯ÊýÓÃÓڹرÕת»»¾ä±ú,ÊÍ·Å×ÊÔ´¡£
Àý×Ó1: ÓÃCÓïÑÔʵÏÖµÄת»»Ê¾Àý³ÌÐò
/* f.c : ´úÂëת»»Ê¾ÀýC³ÌÐò */
#include <iconv.h>
#define OUTLEN 255
main()
{
char *in_utf8 = "æ­£å?¨å??è£?";
char *in_gb2312 = "ÕýÔÚ°²×°";
char out[OUTLEN];
//unicodeÂëתΪgb2312Âë
rc = u2g(in_utf8,strlen(in_utf8),out,OUTLEN);
printf("unicode-->gb2312 out=%sn",out);
//gb2312ÂëתΪunicode ......

linuxÏÂddÃüÁîÏê½â

 
ÏȼòÒª½éÉÜÏÂddµÄ²ÎÊý£¬ºó±ßͨ¹ý¼¸¸öʵÀý½éÉÜddµÄÓ¦Ó㬲ο¼ÁËÆäËûÍøÓѵÄ×ÊÁÏ£¬ÔÚ´ËÒ»
²¢¸Ðл£¬Ë®Æ½ÓÐÏÞÎÄÖÐÓÐʲô´íÎóÇë´ó¼ÒÖ¸Õý¡£
dd ÊÇ Linux/UNIX ϵÄÒ»¸ö·Ç³£ÓÐÓõÄÃüÁ×÷ÓÃÊÇÓÃÖ¸¶¨´óСµÄ¿é¿½±´Ò»¸öÎļþ£¬²¢ÔÚ¿½±´
µÄͬʱ½øÐÐÖ¸¶¨µÄת»»¡£
1. ÃüÁî¼ò½é
dd µÄÖ÷ҪѡÏ
Ö¸¶¨Êý×ֵĵط½ÈôÒÔÏÂÁÐ×Ö·û½áβ³ËÒÔÏàÓ¦µÄÊý×Ö:
b=512, c=1, k=1024, w=2, xm=number m
if=file
ÊäÈëÎļþÃû£¬È±Ê¡Îª±ê×¼ÊäÈë¡£
of=file
Êä³öÎļþÃû£¬È±Ê¡Îª±ê×¼Êä³ö¡£
ibs=bytes
Ò»´Î¶ÁÈë bytes ¸ö×Ö½Ú(¼´Ò»¸ö¿é´óСΪ bytes ¸ö×Ö½Ú)¡£
obs=bytes
Ò»´Îд bytes ¸ö×Ö½Ú(¼´Ò»¸ö¿é´óСΪ bytes ¸ö×Ö½Ú)¡£
bs=bytes
ͬʱÉèÖöÁд¿éµÄ´óСΪ bytes £¬¿É´úÌæ ibs ºÍ obs ¡£
cbs=bytes
Ò»´Îת»» bytes ¸ö×Ö½Ú£¬¼´×ª»»»º³åÇø´óС¡£
skip=blocks
´ÓÊäÈëÎļþ¿ªÍ·Ìø¹ý blocks ¸ö¿éºóÔÙ¿ªÊ¼¸´ÖÆ¡£
seek=blocks
´ÓÊä³öÎļþ¿ªÍ·Ìø¹ý blocks ¸ö¿éºóÔÙ¿ªÊ¼¸´ÖÆ¡£(ͨ³£Ö»Óе±Êä³öÎļþÊÇ´ÅÅÌ»ò´Å´øʱ²ÅÓÐЧ)¡£
count=blocks
½ö¿½±´ blocks ¸ö¿é£¬¿é´óСµÈÓÚ ibs Ö¸¶¨µÄ×Ö½ÚÊý¡£
conv=conversion[,conversion...]
ÓÃÖ¸¶¨µÄ²ÎÊýת»»Îļþ¡£
ת»»²ÎÊý:
ascii ת»» EBCDIC Ϊ ASCII ......

ÔÚ Linux ÏÂÔËÐÐ ASP.NET 2.0

µ¥Î»ÓÐһ̨ÏÐÖÃµÄ¾É IBM Netfinity 7000 µÄ·þÎñÆ÷£¬Ë« Pentium Pro 200 MHz CPU£¬512 MB Äڴ棬һ¸ö 9.1 GB ºÍÎå¸ö 4.5 GB µÄ SCSI Ó²ÅÌ¡£ÎÒÏ뽫Æä·ÏÎïÀûÓÃһϣ¬ÓÚÊÇ£º
1. µ½ http://tw.releases.ubuntu.com/edgy/ ÏÂÔØ  PC (Intel x86) server install CD £¬½«ÏÂÔصõ½µÄ ubuntu-6.10-server-i386.iso Îļþ¿Ì¼һÕŹâÅÌ¡£
2. ÓÃÕâÕŹâÅÌÔÚ IBM Netfinity 7000 ·þÎñÆ÷ÉÏ°²×° Ubuntu 6.10 (Edgy) ¡£
3. °²×° Apache2:
    sudo apt-get install apache2
4. °²×°»ù±¾µÄ±àÒë»·¾³:
    sudo apt-get install build-essential checkinstall
5. °²×° libapache2-mod-mono:
    ×î¼òµ¥µÄ·½·¨¾ÍÊÇʹÓÃÒÔÏÂÃüÁî:
    sudo apt-get install libapache2-mod-mono
    µ«ÊÇÄ¿Ç°ÔÚ Ubuntu 6.10 ÖÐÕâÌõÃüÁî»á±¨´í¡£Ö»ºÃ×Ô¼º±àÒëÒ»¸öÁË£º
    md src
    cd src
    sudo apt-get install apache2-threaded-dev mono-xsp2 mono-apache-server mono-apache-server2
    wget http://go-mono.com/sources/mod_mono/mod_mono-1.2 ......

ÔÚ Linux ÏÂÔËÐÐ ASP.NET 2.0

µ¥Î»ÓÐһ̨ÏÐÖÃµÄ¾É IBM Netfinity 7000 µÄ·þÎñÆ÷£¬Ë« Pentium Pro 200 MHz CPU£¬512 MB Äڴ棬һ¸ö 9.1 GB ºÍÎå¸ö 4.5 GB µÄ SCSI Ó²ÅÌ¡£ÎÒÏ뽫Æä·ÏÎïÀûÓÃһϣ¬ÓÚÊÇ£º
1. µ½ http://tw.releases.ubuntu.com/edgy/ ÏÂÔØ  PC (Intel x86) server install CD £¬½«ÏÂÔصõ½µÄ ubuntu-6.10-server-i386.iso Îļþ¿Ì¼һÕŹâÅÌ¡£
2. ÓÃÕâÕŹâÅÌÔÚ IBM Netfinity 7000 ·þÎñÆ÷ÉÏ°²×° Ubuntu 6.10 (Edgy) ¡£
3. °²×° Apache2:
    sudo apt-get install apache2
4. °²×°»ù±¾µÄ±àÒë»·¾³:
    sudo apt-get install build-essential checkinstall
5. °²×° libapache2-mod-mono:
    ×î¼òµ¥µÄ·½·¨¾ÍÊÇʹÓÃÒÔÏÂÃüÁî:
    sudo apt-get install libapache2-mod-mono
    µ«ÊÇÄ¿Ç°ÔÚ Ubuntu 6.10 ÖÐÕâÌõÃüÁî»á±¨´í¡£Ö»ºÃ×Ô¼º±àÒëÒ»¸öÁË£º
    md src
    cd src
    sudo apt-get install apache2-threaded-dev mono-xsp2 mono-apache-server mono-apache-server2
    wget http://go-mono.com/sources/mod_mono/mod_mono-1.2 ......

ÔÚ Linux ÏÂÔËÐÐ ASP.NET 2.0

µ¥Î»ÓÐһ̨ÏÐÖÃµÄ¾É IBM Netfinity 7000 µÄ·þÎñÆ÷£¬Ë« Pentium Pro 200 MHz CPU£¬512 MB Äڴ棬һ¸ö 9.1 GB ºÍÎå¸ö 4.5 GB µÄ SCSI Ó²ÅÌ¡£ÎÒÏ뽫Æä·ÏÎïÀûÓÃһϣ¬ÓÚÊÇ£º
1. µ½ http://tw.releases.ubuntu.com/edgy/ ÏÂÔØ  PC (Intel x86) server install CD £¬½«ÏÂÔصõ½µÄ ubuntu-6.10-server-i386.iso Îļþ¿Ì¼һÕŹâÅÌ¡£
2. ÓÃÕâÕŹâÅÌÔÚ IBM Netfinity 7000 ·þÎñÆ÷ÉÏ°²×° Ubuntu 6.10 (Edgy) ¡£
3. °²×° Apache2:
    sudo apt-get install apache2
4. °²×°»ù±¾µÄ±àÒë»·¾³:
    sudo apt-get install build-essential checkinstall
5. °²×° libapache2-mod-mono:
    ×î¼òµ¥µÄ·½·¨¾ÍÊÇʹÓÃÒÔÏÂÃüÁî:
    sudo apt-get install libapache2-mod-mono
    µ«ÊÇÄ¿Ç°ÔÚ Ubuntu 6.10 ÖÐÕâÌõÃüÁî»á±¨´í¡£Ö»ºÃ×Ô¼º±àÒëÒ»¸öÁË£º
    md src
    cd src
    sudo apt-get install apache2-threaded-dev mono-xsp2 mono-apache-server mono-apache-server2
    wget http://go-mono.com/sources/mod_mono/mod_mono-1.2 ......

½»²æ±àÒë»ùÓÚARMÌåϵ½á¹¹µÄLinuxÄÚºË

½»²æ±àÒë»ùÓÚARMµÄLinuxÄÚºË֮ǰ,ÎÒÃÇ×÷ÒÔϵÄ×¼±¸¹¤×÷£º
  1¡¢ÒѾ­°²×°ºÃÒ»Ì×ÄãÊìϤµÄ½»²æ±àÒ빤¾ß£¨½¨Á¢ºÃ½»²æ±àÒë»·¾³£©¡£
  2¡¢Ñ¡ÔñÒ»Ì×ÄãÊìϤµÄ¹¦ÄÜ×ã¹»ÄãʹÓõÄÄںˣ¬µ±È»£¬Õâ¸öÄÚºËÊÇÊʺÏÓÃÄãµÄ½»²æ±àÒ빤¾ß±àÒëµÄ¡£
  ÕÆÎÕÒÔÉÏ2µã£¬»ù±¾ÉϾͲ¶àÁË¡£ÕâÀïĬÈÏÄãÖªµÀµÄһЩ³£ÓÃ֪ʶ£­£­£­£­ÃüÁVI£¦³£Ê¶Ê²Ã´µÄÄãÒѾ­Á˽⡣
  ¿ªÊ¼±àÒ룺
  1¡¢ÏÂÔØÄںˣº
     ÏÂÔØÒ»¸öÄã¾õµÃ¿ÉÒÔÂú×ãÄãµÄÉè¼ÆÒªÇóÓÖ²»ÖÁÓÚÌ«Ä°ÉúµÄLinuxÄںˣ¬¶Ô¿ª·¢ÊǷdz£Óкô¦µÄ£¬ÎÒÑ¡ÔñµÄÊÇ£º
     linux-2.6.26ÄÚºË £¦ arm-linux-gcc-3.4.1¹¤¾ßÁ´¡£
     ÀíÓɺܳä·Ö£ºlinux-2.6.26ÄÚºËÂú×ãÎÒµ½ÐèÒª¶øÇÒ¿´ÆðÀ´×㹻У¬²¢ÇÒarm-linux-gcc-3.4.1¹¤¾ßÁ´¶Ôlinux-2.6.xÄں˵ÄÖ§³ÖÒ²×ã¹»³öÉ«£¡
     ÏÂÔØÄÚºËѹËõÎļþ£ºlinux-2.6.26.tar.bz2
  2¡¢½¨Á¢¿ª·¢Ä¿Â¼£º
     Õâ¸ö¾Í¼òµ¥¶àÁË£¬°ÑѹËõ°ücopyµ½Ò»¸ö·¾¶ÇåÎúµÄн¨Îļþ¼ÐÏÂ(Äã²»»áÍüÁËÆðÃû×Ö°É)£¬¿ªÊ¼½âѹËõ £ºtar -xvjf linux-2.6.26.tar.bz2
     µÈ´ý……& ......

linux shell±à³ÌÈëÃÅ

ͨ³£Çé¿öÏ£¬ÎÒÃÇ´ÓÃüÁîÐÐÊäÈëÃüÁîÿÊäÈëÒ»´Î¾ÍÄܹ»µÃµ½ÏµÍ³µÄÒ»´ÎÏìÓ¦¡£Ò»µ©ÐèÒªÎÒÃÇÒ»¸ö½Ó×ÅÒ»¸öµÄÊäÈëÃüÁî¶ø×îºó²ÅµÃµ½½á¹ûµÄʱºò£¬ÕâÑùµÄ×ö·¨ÏÔÈ»¾ÍûÓÐЧÂÊ¡£Òª´ïµ½ÕâÑùµÄÄ¿µÄ£¬Í¨³£ÎÒÃÇÀûÓÃshell³ÌÐò»òÕßshell½Å±¾À´ÊµÏÖ¡£
Ò»¡¢¼ò½é
Shell±à³ÌÓкܶàÀàËÆCÓïÑÔºÍÆäËû³ÌÐòÓïÑÔµÄÌØÕ÷£¬µ«ÊÇÓÖûÓбà³ÌÓïÑÔÄÇÑù¸´ÔÓ¡£Shell³ÌÐò¾ÍÊÇ·ÅÔÚÒ»¸öÎļþÖеÄһϵÁÐLinuxÃüÁîºÍʵÓóÌÐò£¬ÔÚÖ´ÐеÄʱºò£¬Í¨¹ýLinuxÒ»¸ö½Ó×ÅÒ»¸öµØ½âÊͺÍÖ´ÐÐÿ¸öÃüÁî¡£
ÏÂÃæÎÒÃÇÀ´¿´Ò»¸ö¼òµ¥µÄshell³ÌÐò£º
      1¡¢Ê×ÏȽ¨Á¢Ò»¸öÄÚÈÝÈçϵÄÎļþ£¬Ãû×ÖΪdate,½«Æä´æ·ÅÔÚĿ¼ÏµÄbin×ÓĿ¼ÖС£
   ¡¡#Program date
¡¡¡¡#usageto ::show the date in this way (×¢ÊÍ)
¡¡¡¡echo "Mr.$USER,Today is:"
¡¡¡¡echo date "+%B%d%A"
¡¡¡¡echo "Whish you a lucky day !"
¡¡¡¡2¡¢±à¼­Íê¸ÃÎļþÖ®ºóËü»¹²»ÄÜÖ´ÐУ¬ÎÒÃÇÐèÒª¸øËüÉèÖÿÉÖ´ÐÐȨÏÞ¡£Ê¹ÓÃÈçÏÂÃüÁ
¡¡¡¡chmod +x date
¡¡¡¡Í¨¹ýÒÔÉϹý³ÌÖ®ºó£¬ÎÒÃǾͿÉÒÔÏñʹÓÃlsÃüÁîÒ»ÑùÖ´ÐÐÕâ¸öshell³ÌÐò.
¡¡¡¡[beichen@localhost bin]$ date
¡¡¡¡Mr.beichen,Today is:
¡¡¡¡January 13 Friday
¡¡¡¡Whish you a lucky day ......
×ܼǼÊý:5772; ×ÜÒ³Êý:962; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [953] [954] [955] [956] [957] [958] [959] [960] 961 [962]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ