Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

LinuxµÄÖ÷ÒªÌص㼰½á¹¹

LinuxµÄÖ÷ÒªÌصã
¡¡¡¡×÷Ϊһ¸ö²Ù×÷ϵͳ£¬Linux¼¸ºõÂú×ãµ±½ñUnix²Ù×÷ϵͳµÄËùÓÐÒªÇó£¬Òò´Ë£¬Ëü¾ßÓÐUnix²Ù×÷ϵͳµÄ»ù±¾ÌØÕ÷¡£
1.·ûºÏPOSIX 1003.1±ê×¼
¡¡ ¡¡POSIX 1003.1±ê×¼¶¨ÒåÁËÒ»¸ö×îСµÄUnix²Ù×÷ϵͳ½Ó¿Ú£¬ÈκβÙ×÷ϵͳֻÓзûºÏÕâÒ»±ê×¼£¬²ÅÓпÉÄÜÔËÐÐUnix³ÌÐò¡£Unix¾ßÓзḻµÄÓ¦ÓóÌÐò£¬µ±½ñ¾ø ´ó¶àÊý²Ù×÷ϵͳ¶¼°ÑÂú×ãPOSIX 1003.1±ê×¼×÷ΪʵÏÖÄ¿±ê£¬LinuxÒ²²»ÀýÍ⣬ËüÍêÈ«Ö§³ÖPOSIX 1003.1±ê×¼¡£
2.Ö§³Ö¶àÓû§·ÃÎʺͶàÈÎÎñ±à³Ì
¡¡¡¡LinuxÊÇÒ»¸ö¶àÓû§²Ù×÷ϵͳ£¬ËüÔÊÐí¶à¸öÓû§Í¬Ê±·ÃÎÊϵͳ¶ø²»»áÔì³ÉÓû§Ö®¼äµÄÏ໥¸ÉÈÅ¡£ÁíÍ⣬Linux»¹Ö§³ÖÕæÕýµÄ¶àÓû§±à³Ì£¬Ò»¸öÓû§¿ÉÒÔ´´½¨¶à¸ö½ø³Ì£¬²¢Ê¹¸÷¸ö½ø³ÌЭͬ¹¤×÷À´Íê³ÉÓû§µÄÐèÇó¡£
3.²ÉÓÃҳʽ´æ´¢¹ÜÀí
¡¡¡¡Ò³Ê½´æ´¢¹ÜÀíʹLinuxÄܸüÓÐЧµØÀûÓÃÎïÀí´æ´¢¿Õ¼ä£¬Ò³ÃæµÄ»»Èë»»³öΪÓû§ÌṩÁ˸ü´óµÄ´æ´¢¿Õ¼ä¡£
4.Ö§³Ö¶¯Ì¬Á´½Ó
¡¡ ¡¡Óû§³ÌÐòµÄÖ´ÐÐÍùÍùÀë²»¿ª±ê×¼¿âµÄÖ§³Ö£¬Ò»°ãµÄϵͳÍùÍù²ÉÓþ²Ì¬Á´½Ó·½Ê½£¬¼´ÔÚ×°Åä½×¶Î¾ÍÒѽ«Óû§³ÌÐòºÍ±ê×¼¿âÁ´½ÓºÃ£¬ÕâÑù£¬µ±¶à¸ö½ø³ÌÔËÐÐʱ£¬¿ÉÄÜ»á ³öÏÖ¿â´úÂëÔÚÄÚ´æÖÐÓжà¸ö¸±±¾¶øÀË·Ñ´æ´¢¿Õ¼äµÄÇé¿ö¡£Linux Ö§³Ö¶¯Ì¬Á´½Ó·½Ê½£¬µ±ÔËÐÐʱ²Å½øÐпâÁ´½Ó£¬Èç¹ûËùÐèÒªµÄ¿âÒѱ»ÆäËü½ø³Ì×°ÈëÄڴ棬Ôò²»±ØÔÙ×°È룬·ñÔò²Å´ÓÓ²ÅÌÖн«¿âµ÷Èë¡£ÕâÑùÄܱ£Ö¤ÄÚ´æÖеĿâ³ÌÐò´úÂëÊÇ Î¨Ò»µÄ¡£
5.Ö§³Ö¶àÖÖÎļþϵͳ
¡¡¡¡LinuxÄÜÖ§³Ö¶àÖÖÎļþϵͳ¡£Ä¿Ç°Ö§³ÖµÄÎļþϵͳÓУºEXT2¡¢EXT¡¢XIAFS¡¢ ISOFS¡¢HPFS¡¢MSDOS¡¢UMSDOS¡¢PROC¡¢NFS¡¢SYSV¡¢MINIX¡¢SMB¡¢UFS¡¢NCP¡¢VFAT¡¢AFFS¡£Linux×î ³£ÓõÄÎļþϵͳÊÇEXT2£¬ËüµÄÎļþÃû³¤¶È¿É´ï255×Ö·û£¬²¢ÇÒ»¹ÓÐÐí¶àÌØÓеŦÄÜ£¬Ê¹Ëü±È³£¹æµÄUnixÎļþϵͳ¸ü¼Ó°²È«¡£
6.Ö§³ÖTCP/IP¡¢SLIPºÍPPP
¡¡¡¡ÔÚLinuxÖУ¬Óû§¿ÉÒÔʹÓÃËùÓеÄÍøÂç·þÎñ£¬ÈçÍøÂçÎļþϵͳ¡¢Ô¶³ÌµÇ¼µÈ¡£SLIPºÍPPPÄÜÖ§³Ö´®ÐÐÏßÉϵÄTCP/IPЭÒéµÄʹÓã¬ÕâÒâζ×ÅÓû§¿ÉÓÃÒ»¸ö¸ßËÙModemͨ¹ýµç»°ÏßÁ¬ÈëInternetÍøÖС£
³ýÁËÉÏÊö»ù±¾ÌØÕ÷Í⣬ Linux»¹¾ßÓÐÆä¶ÀÓеÄÌØÉ«£º
¡¡ ¡¡Ö§³ÖÓ²Å̵Ķ¯Ì¬Cache ÕâÒ»¹¦ÄÜÓëMS-DOSÖеÄSmartdriveÏàËÆ¡£Ëù²»Í¬µÄÊÇ£¬LinuxÄܶ¯Ì¬µ÷ÕûËùÓõÄCache´æ´¢Æ÷µÄ´óС£¬ÒÔÊʺϵ±Ç°´æ´¢Æ÷µÄʹÓÃÇé¿ö£¬µ± ijһʱ¿ÌûÓиü¶àµÄ´æ´¢¿Õ¼ä¿ÉÓÃʱ£¬Cache½«±»¼õÉÙ£¬ÒÔÔö¼Ó¿ÕÏеĴ洢¿Õ¼ä£¬Ò»µ©´æ´¢¿Õ¼ä²»ÔÙ½ôÕÅ£¬CacheµÄ´óСÓÖ½«Ôö¼Ó¡£
¡¡¡¡ Ö§³Ö²»Í¬¸ñʽµÄ¿ÉÖ´ÐÐÎļþ Linux¾ßÓжàÖÖÄ£ÄâÆ÷£¬ÕâʹËüÄÜÔËÐв»Í¬¸ñʽµÄÄ¿±êÎļþ¡£ÆäÖУ¬DOS£¨DOSEMU£©ºÍMS-Windows


Ïà¹ØÎĵµ£º

Linux ϱàÒëhello world µÄC ÓïÑÔ³ÌÐò

±¾À´ÎÒÓõÄÊÇÕâÑùµÄ³ÌÐò
# include <iostream.h>
int main(void)
{
  int i,j;
  j=0;
  i=j+1;
  cout<<"hello world!"<<endl;
  cout<<"the result is"<<i<<endl;
  return 0;
}
ÀûÓÃg++ -o test test.cpp¡£µ«ÊÇÕâÑùÊÇÓдíÎóµÄ£¬ÌáʾÎÞ·¨´ ......

linux±à³Ì——ÐźÅƪ£Ûת£Ý

ÐźŻù±¾Ô­Àí

LinuxÊÇÒ»ÖÖ¶àÓû§¶àÈÎÎñµÄ²Ù×÷ϵͳ£¬ÏµÍ³ÄÚ»áÓжà¸ö½ø³Ì´æÔÚ¡£ÎÞÂÛÊDzÙ×÷ϵͳÓëÓû§½ø³ÌÖ®¼ä£¬»¹ÊÇÓû§½ø³ÌÖ®¼ä£¬¾­³£ÐèÒª¹²ÏíÊý¾ÝºÍ½»»»ÐÅÏ¢¡£½ø³Ì
¼äÏ໥ͨÐŵķ½·¨ÓжàÖÖ£¬ÐźűãÊÇÆäÖÐ×îΪ¼òµ¥µÄÒ»ÖÖ£¬ËüÓÃÒÔÖ¸³öijʼþµÄ·¢Éú¡£ÔÚLinuxϵͳÖУ¬¸ù¾Ý¾ßÌåµÄµÄÈíÓ²¼þÇé¿ö£¬Äں˳ÌÐò»á·¢³ö²»Í¬µÄÐźŠ......

Linux¶¨Ê±Æô¶¯ÈÎÎñµÄһЩÃüÁî...

/*
 * Ò»ÄêÇ°ÕûµÄһЩ×ÊÁÏ£¬ÔÚ²»Åª³öÀ´Õæ²»ÖªµÀÄÇÌì¾ÍûÁË£¬±¾ÉíÎÒÊǸöÀÁÉ¢µÄÈË£¬Ò²²»ÏëÔÙÕÒµÚ¶þ´Î£¡
 * ÏÂÃæµÄÄÚÈÝÒ²ÊÇÒÔÇ°baidu/GoogleµÄ£¬È»ºóÕûÀíÁËÏÂÃæµÄ×ÊÁÏ¡£ÍüÁËÊDz»ÊǶ¼ÄÜÓÃÁË£¬µ±Ê±Ö»ÊÔÁËÒ»²¿·Ö¡£¡£¡£
 */
ҪʹÓÃ×Ô¶¯Æô¶¯½ø³ÌµÄ¹¦ÄÜ,¾ÍÐèÒªÕÆÎÕÒÔϼ¸¸öÆô¶¯ÃüÁî:
  at ÃüÁî
========== ......

linux lsÖ»ÊÇÁгöÎļþ¼Ð

ls -l|grep ^d    ----Áгöµ±Ç°Ä¿Â¼ÏµÄÎļþ¼Ð
ls -l|grep ^d|grep "tmp"  ----Áгöµ±Ç°Ä¿Â¼ÏÂÃ÷×Óº¬ÓÐ"tmp"µÄÎļþ¼Ð
for dir in `ls -l ~/dxy/|grep ^d | awk '{print $9}'`  ---- awk '{print $9}' ,Ö»print Îļþ¼ÐµÄÃû×Ö
do
echo "==== $dir"
cd ~/dxy;cd ......

[Pthread] Linux³ÌÐòµ÷ÊԵĻùʯ(¶þ)


3. GDBµÄʵÏÖ
GDBÊÇGNU·¢²¼µÄÒ»¸öÇ¿´óµÄ³ÌÐòµ÷ÊÔ¹¤¾ß£¬ÓÃÒÔµ÷ÊÔC/C++³ÌÐò¡£¿ÉÒÔʹ³ÌÐòÔ±ÔÚ³ÌÐòÔËÐеÄʱºò¹Û²ì³ÌÐòÔÚÄÚ´æ/¼Ä´æÆ÷ÖеÄʹÓÃÇé¿ö¡£ËüµÄʵÏÖÒ²ÊÇ»ùÓÚptraceϵͳµ÷ÓÃÀ´Íê³ÉµÄ¡£
Æä
Ô­ÀíÊÇÀûÓÃptraceϵͳµ÷Óã¬ÔÚ±»µ÷ÊÔ³ÌÐòºÍgdbÖ®¼ä½¨Á¢¸ú×Ù¹Øϵ¡£È»ºóËùÓз¢Ë͸ø±»µ÷ÊÔ³ÌÐòµÄÐźÅ(³ýSIGKILL)¶¼»á±»gdb½Ø ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ