Linux C ¿ª·¢»·¾³(debian)
#apt-get install gcc (±àÒëÆ÷)
#apt-get install gdb (µ÷ÊÔ)
#apt-get install libc6-dev (¿ª·¢¿â)
Èç¹ûûÓпª·¢¿â£¬gccµÄʱºò¾Í»á´íÎó
gcc h.c
h.c: In function ‘main’:
h.c:1: warning: incompatible implicit declaration of built-in function ‘printf ’
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
°²×°ºó¾ÍûÓÐÎÊÌâÁË£º
gcc h.c
h.c: In function ‘main’:
h.c:1: warning: incompatible implicit declaration of built-in function ‘printf
gcc -o hello hello.c
hello.c: In function ‘main’:
hello.c:2: warning: incompatible implicit declaration of built-in function ‘printf’
james@debian:~$ ls
a.out h.c hello hello.c
james@debian:~$ ./hello
Hello Linux
james@debian:~$
Ïà¹ØÎĵµ£º
Linux ¾ÍÊÇͨ³£Ëù˵µÄµ¥Äںˣ¨monolithic kernel£©£¬¼´²Ù×÷ϵͳµÄ´ó²¿·Ö¹¦Äܶ¼±»³ÆÎªÄںˣ¬²¢ÔÚÌØÈ¨Ä£Ê½ÏÂÔËÐС£ËüÓë΢ÐÍÄÚºË ²»Í¬£¬ºóÕßÖ»°Ñ»ù±¾µÄ¹¦ÄÜ£¨½ø³Ì¼äͨÐÅ [IPC]¡¢µ÷¶È¡¢»ù±¾µÄÊäÈë/Êä³ö [I/O] ºÍÄÚ´æ¹ÜÀí£©µ±×÷ÄÚºËÔËÐУ¬¶ø°ÑÆäËû¹¦ÄÜ£¨Çý¶¯³ÌÐò¡¢ÍøÂç¶ÑÕ»ºÍÎļþϵͳ£©ÅųýÔÚÌØÈ¨¿Õ¼äÖ®Íâ¡£Òò´Ë£¬Äú¿ÉÄÜÈ ......
1¡¢½«Îļþcheckoutµ½±¾µØÄ¿Â¼
svn checkout path£¨pathÊÇ·þÎñÆ÷ÉϵÄĿ¼£©
ÀýÈ磺svn checkout svn://192.168.1.1/pro/domain
¼òд£ºsvn co
2¡¢Íù°æ±¾¿âÖÐÌí¼ÓеÄÎļþ
svn add file
ÀýÈ磺svn add test.php(Ìí¼Ótest.php)
svn add *.php(Ìí¼Óµ±Ç°Ä¿Â¼ÏÂËùÓеÄphpÎÄ ......
Some humorous things to do to a UNIX system:
from the csh (c shell):
% make love
Make: Don't know how to make love. Stop.
% got a light?
No match.
% sleep with me
bad character
% man: Why did you get a divorce?
man:: Too many arguments.
% rm God
rm: ......
linuxĿ¼¼Ü¹¹
/ ¸ùĿ¼
/bin ³£ÓõÄÃüÁî binary file µÄÄ¿錄
/boot ´æ·ÅϵͳÆô¶¯Ê±±ØÐë¶ÁÈ¡µÄµµ°¸£¬°üÀ¨ºËÐÄ (kernel) ÔÚÄÚ
/boot/grub/menu.lst GRUBÉèÖÃ
/boot/vmlinuz ÄÚºË
& ......
#include <stdio.h>
#include <stdlib.h> //use malloc, free
#include <string.h> //use memset
#include <ctype.h> //use isdigit
#define ERROR_ILLEGAL_CHAR 1 //define error illegal character as 1
#define ERROR_NUMBERS_DIF 2 //define error numbers is not the same in diffe ......