ºìÁªLinuxÃÅ»§
Linux°ïÖú

linuxÏÂʵÏÖhello world!

·¢²¼Ê±¼ä:2012-04-11 23:56:47À´Ô´:ºìÁª×÷Õß:songjiacai
ϵͳ£ºÐéÄâ»ú+DEBIAN
Äںˣº2.6.32
˵Ã÷£º´ËʱĬÈÏϵͳÖÐÒѾ­×°ºÃGCC±àÒëÆ÷¡£
Öն˲Ù×÷ÈçÏ£º
su root #½øÈëroot
#ÊäÈëÃÜÂë
cd /tmp
vi hello.c
#½øÈëVIÖбà³Ì
#include

int main(void)
{
printf("hello world!");
return 0;
}
#±£´æÍ˳ö£¬VIÖеÄÃüÁîÊÇ ÏÈESCÈ»ºóÇÃÈë:wq
gcc hello.c -o a.out #Ö±½Ó±àÒëÉú³É¿ÉÖ´ÐÐÎļþ£¬ÆäÖÐ.outµÄÎļþÃû²»ÒªºÍ.cÎļþÃûÏàͬ
#±àÒëͨ¹ý£¬ÈôûÓÐͨ¹ý×Ðϸ¼ì²é´úÂ룬Èô´úÂëûÓÐÎÊÌ⣬¿ÉÄÜÊÇÍ·ÎļþµÄ·¾¶ÓÐÎÊÌâ
#Ò»°ãÍ·ÎļþÓ¦¸ÃÔÚ/usr/include£¬Èô²»ÊǵĻ°ÐèÒªÁíÍâÔö¼ÓÍ·ÎļþµÄ·¾¶£¬´Ëʱ¿ÉÄܾͱȽÏÂé·³
#ÁË¡£ÒòΪ¿ÉÄܲ¢²»ÖªµÀÍ·ÎļþÔÚÄÄ£¬´ËʱÎÒÖ»ÄÜ°®ÄªÄÜÖúÁË¡£¶ÔÄãÔâÓö±íʾͬÇ飬µ«Ï£ÍûÄã²»Òª»ÒÐÄ£¬
#ÎÊÌâ×ÜÊÇ»á½â¾öµÄ¡£
#ÔËÐпÉÖ´ÐÐÎļþ
./a.out
#Èç¹û˳Àû£¬»áÔÚÖն˳öÏÖhello world!×Ö·û´®¡£
#ÖÁ´Ë£¬linuxϵÄhello world!¾ÍÍê³ÉÁË¡£
#OK,let's go!
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 50 ÌõÆÀÂÛ

  1. xiangying88 ÓÚ 2012-04-21 12:44:06·¢±í:

    {:3_115:} ²»´í

  2. eternal_lm ÓÚ 2012-04-19 19:03:15·¢±í:

    ÒѾ­ÔÚredhatʵÏÖÁË

  3. ÓÚ 2012-04-18 20:14:21·¢±í:

    Ū½ØͼҲÐа¡£¬¿´²»¶®£¬¾ßÌåʲôÑùµÄЧ¹û°¡....

  4. 1547969992 ÓÚ 2012-04-16 11:32:50·¢±í:

    ÎÒ¸Õ¿ªÊ¼½Ó´¥ ¿´²»¶®°¡

  5. wasdj72222 ÓÚ 2012-04-14 22:27:38·¢±í:

    ÓÐɶÓᣡ£¡£

  6. secondround ÓÚ 2012-04-14 11:27:05·¢±í:

    ÐÂÊÖ£¬ÓÐЩ²»ÖªËù´ë

  7. gviwin ÓÚ 2012-04-12 16:57:40·¢±í:

    :0)1¸Ðлsongjiacai µÄ·ÖÏí¡£ºÇºÇ
    ȷʵͦ±ê×¼µÄ£¡
    ÐÂÊÖѧϰÁË£¡

  8. personball ÓÚ 2012-04-12 14:16:10·¢±í:

    lzÕâÊÇLinux C ±à³Ì°æ£¬Âù±ê×¼µÄ

    [perl °æ]µ±È»ÒªÓÐÏàÓ¦µÄ½âÊÍÆ÷»·¾³£¬¿ÉÒÔperl -v¿´Ï°汾ÐÅÏ¢
    $cat perl_hello
    #!/usr/bin/perl
    print "Hello,world!\n";
    $./perl_hello

    [ruby °æ]ruby -v²é¿´ruby°æ±¾
    $cat ruby_hello
    p "Hello,World!"
    $ruby ruby_hello

  9. GrowthÕ× ÓÚ 2012-04-12 09:38:15·¢±í:

    ¸ÐлsongjiacaiµÄ·ÖÏí£¬±¾Ìù¼ÓÈëµ½ÂÛ̳¶¥ÖõÄLinuxÓ¦ÓÃÌùÖÐ

  10. urowoen ÓÚ 2012-04-12 08:53:58·¢±í:

    good