Ïêϸ½²½â ¹ØÓÚLinux¾²Ì¬¿âºÍ¶¯Ì¬¿âµÄ·ÖÎö
»ù±¾¸ÅÄî
¿âÓж¯Ì¬Ó뾲̬Á½ÖÖ£¬¶¯Ì¬Í¨³£ÓÃ.soΪºó׺£¬¾²Ì¬ÓÃ.aΪºó׺¡£
ÀýÈ磺libhello.so libhello.a ΪÁËÔÚͬһϵͳÖÐʹÓò»Í¬°æ±¾µÄ¿â£¬¿ÉÒÔÔÚ¿âÎļþÃûºó¼ÓÉÏ°æ±¾ºÅΪºó׺,ÀýÈ磺 libhello.so.1.0,ÓÉÓÚ³ÌÐòÁ¬½ÓĬÈÏÒÔ.soΪÎļþºó׺Ãû¡£ËùÒÔΪÁËʹÓÃÕâЩ¿â£¬Í¨³£Ê¹Óý¨Á¢·ûºÅÁ¬½ÓµÄ·½Ê½¡£
ln -s libhello.so.1.0 libhello.so.1
ln -s libhello.so.1 libhello.so
1¡¢Ê¹Óÿâ
µ±ÒªÊ¹Óþ²Ì¬µÄ³ÌÐò¿âʱ£¬Á¬½ÓÆ÷»áÕÒ³ö³ÌÐòËùÐèµÄº¯Êý£¬È»ºó½«ËüÃÇ¿½±´µ½Ö´ÐÐÎļþ£¬ÓÉÓÚÕâÖÖ¿½±´ÊÇÍêÕûµÄ£¬ËùÒÔÒ»µ©Á¬½Ó³É¹¦£¬¾²Ì¬³ÌÐò¿âÒ²¾Í²»ÔÙÐèÒªÁË¡£È» ¶ø£¬¶Ô¶¯Ì¬¿â¶øÑÔ£¬¾Í²»ÊÇÕâÑù¡£¶¯Ì¬¿â»áÔÚÖ´ÐгÌÐòÄÚÁôÏÂÒ»¸ö±ê¼ÇÖ¸Ã÷µ±³ÌÐòÖ´ÐÐʱ£¬Ê×ÏȱØÐëÔØÈëÕâ¸ö¿â¡£ÓÉÓÚ¶¯Ì¬¿â½ÚÊ¡¿Õ¼ä£¬linuxϽøÐÐÁ¬½ÓµÄȱʡ²Ù×÷ÊÇÊ×ÏÈÁ¬½Ó¶¯Ì¬¿â£¬Ò²¾ÍÊÇ˵£¬Èç¹ûͬʱ´æÔÚ¾²Ì¬ºÍ¶¯Ì¬¿â£¬²»ÌرðÖ¸¶¨µÄ»°£¬½«Ó붯̬¿âÏàÁ¬½Ó¡£ ÏÖÔÚ¼ÙÉèÓÐÒ»¸ö½ÐhelloµÄ³ÌÐò¿ª·¢°ü£¬ËüÌṩһ¸ö¾²Ì¬¿âlibhello.a Ò»¸ö¶¯Ì¬¿âlibhello.so,Ò»¸öÍ·Îļþhello.h,Í·ÎļþÖÐÌṩsayhello()Õâ¸öº¯Êý /* hello.h */ void sayhello(); ÁíÍ⻹ÓÐһЩ˵Ã÷Îĵµ¡£
ÕâÒ»¸öµäÐ͵ijÌÐò¿ª·¢°ü½á¹¹ Ó붯̬¿âÁ¬½Ó linuxĬÈϵľÍÊÇÓ붯̬¿âÁ¬½Ó£¬ÏÂÃæÕâ¶Î³ÌÐòtestlib.cʹÓÃhello¿âÖеÄsayhello()º¯Êý
/*testlib.c*/
#include <>
#include <>
int main()
{
sayhello();
return 0;
}
ʹÓÃÈçÏÂÃüÁî½øÐбàÒë $gcc -c testlib.c -o testlib.o
ÓÃÈçÏÂÃüÁîÁ¬½Ó£º $gcc testlib.o -lhello -o testlib
Á¬½ÓʱҪעÒ⣬¼ÙÉèlibhello.o ºÍlibhello.a¶¼ÔÚȱʡµÄ¿âËÑË÷·¾¶ÏÂ/usr/libÏ£¬Èç¹ûÔÚÆäËüλÖÃÒª¼ÓÉÏ-L²ÎÊý ÓëÓ뾲̬¿âÁ¬½ÓÂ鷳һЩ£¬Ö÷ÒªÊDzÎÊýÎÊÌâ¡£»¹ÊÇÉÏÃæµÄÀý×Ó£º
$gcc testlib.o -o testlib -WI,-Bstatic -lhello
×¢£ºÕâ¸öÌرðµÄ"-WI£¬-Bstatic"²ÎÊý£¬Êµ¼ÊÉÏÊÇ´«¸øÁËÁ¬½ÓÆ÷ld¡£Ö¸Ê¾ËüÓ뾲̬¿âÁ¬½Ó£¬Èç¹ûϵͳÖÐÖ»Óо²Ì¬¿âµ±È»¾Í²»ÐèÒªÕâ¸ö²ÎÊýÁË¡£ Èç¹ûÒªºÍ¶à¸ö¿âÏàÁ¬½Ó£¬¶øÿ¸ö¿âµÄÁ¬½Ó·½Ê½²»Ò»Ñù£¬±ÈÈçÉÏÃæµÄ³ÌÐò¼ÈÒªºÍlibhello½øÐо²Ì¬Á¬½Ó£¬ÓÖÒªºÍlibbye½øÐж¯Ì¬Á¬½Ó£¬ÆäÃüÁîӦΪ£º
$gcc testlib.o -o testlib -WI,-Bstatic -lhello -WI,-Bdynamic -lbye
2¡¢¶¯Ì¬¿âµÄ·¾¶ÎÊÌâ ΪÁËÈÃÖ´ÐгÌÐò˳ÀûÕÒµ½¶¯Ì¬¿â£¬ÓÐÈýÖÖ·½·¨£º
&nb
Ïà¹ØÎĵµ£º
MYSQL°²×°
//½âѹ±àÒë°²×°
# tar xzvf mysql-5.0.27.tar.gz
# cd mysql-5.0.27
# ./configure -prefix=/home/redadmin/mysql
# make
# make install
# cd /home/redadmin/mysql/
# cp share/mysql/my-medium.cnf ./
# mv my-medium.cnf my.cnf
// my.confÎļþÐÞ¸Ä
# vi my.cnf
ÐÞ¸ÄÇ°£º
port &nb ......
²é¿´·¢ÐаæÐÅÏ¢£º
lsb_release -a Õâ¸ö×îÏêϸ
²é¿´Äں˺ͲÙ×÷ϵͳλÊý£º
uname -a
64λ²Ù×÷ϵͳÓÐÀàËÆÐÅÏ¢£º.... x86_64 x86_64 x86_64...
32λ²Ù×÷ϵͳÓÐÀàËÆÐÅÏ¢£º.... i686 i686 i386...
²é¿´cpuÐÅÏ¢£º
more /proc/cpuinfo
²é¿´ºÍ¿ØÖÆϵͳ·þÎñ£¨Èç iptables·À»ðǽµÄ¿ªºÍ¹Ø£©£º
chkconfig ²é¿´ºÍÉ趨·þÎñÔÚ²»Í¬ ......
ssh³£ÓÃÃüÁî
Ŀ¼£º
1. Basic Instructions /»ù±¾Ö¸Áî
2. wget /ÏÂÔع¤¾ß
3. Crontab /¶¨Ê±ÈÎÎñ
4. tar/tar.gz /ѹËõÎļþ
5. vi /±à¼Æ÷
1. Basic Instructions»ù±¾²Ù×÷ÃüÁî
ͨ³£À´Ëµ£¬Ê¹ÓÃ"$[Instructions] --help"¿ÉÒÔ»ñµÃÒÔϸ÷¸öÃüÁî[instructions]µÄ°ïÖú£¬°üº¬Æä²ÎÊýÁбíµÄ¶¨Òå¡£
-ls Áгöµ±Ç°Îļþ¼Ð ......
µÚÒ»´ÎÔÚLinuxϱà³Ì¡£ºÇºÇ
ÔÚÍøÉÏËÑË÷ÁËÒ»ÏÂÔõôÑùÔÚLinuxϱà³Ì¡£ËµÊÇÓÃGeditдºÃ´úÂ룬Ȼºó±£´æ.c¸ñʽÎļþ¡£È»ºóµ½Öն˱àÒë¡£
´ò¿ªGedit.ÀϹæ¾Ø£¬ÏÈÀ´¸öHello.c
#include <stdio.h>
main()
{
printf("Hello~!Vimo~~\n\n");
}
±£´æ¡£È»ºó´ò¿ªÖնˡ£
±àÒëÊÇʲôÃüÁû°ì·¨£¬ÎÊÏÂͬѧ¡£°¢Áé¸æËßÎÒ£º ......
Ò»£®Ìî¿ÕÌ⣺
1. ÔÚLinuxϵͳÖУ¬ÒÔ Îļþ ·½Ê½·ÃÎÊÉ豸 ¡£
2. LinuxÄÚºËÒýµ¼Ê±£¬´ÓÎļþ /etc/fstab ÖжÁÈ¡Òª¼ÓÔصÄÎļþϵͳ¡£
3. LinuxÎļþϵͳÖÐÿ¸öÎļþÓà i½Úµã À´±êʶ¡£
4. È«²¿´ÅÅÌ¿éÓÉËĸö²¿·Ö×é³É£¬·Ö±ðΪÒýµ¼¿é ¡¢×¨ÓÃ¿é ¡¢ i½Úµã±í¿é ºÍÊý¾Ý´æ´¢¿é¡£
5. Á´½Ó·ÖΪ£º Ó²Á´½Ó ºÍ ·ûºÅÁ´½Ó ¡£
6. ³¬¼¶¿é°üº¬ÁËi½ ......