liunuxÈëÃų£ÓÃÃüÁî
liunux
2009-04-13 17:04
ÔĶÁ200 ÆÀÂÛ0
×ֺţº
´ó
´ó
ÖÐ
ÖÐ
С
С
¡¡Linux³£ÓÃÃüÁîµÄ·ÖÀà½éÉÜ£º
¡¡¡¡1.Linux½øÈëÓëÍ˳öϵͳ
¡¡¡¡2.LinuxÎļþµÄ¸´ÖÆ¡¢É¾³ýºÍÒÆ¶¯ÃüÁî
¡¡¡¡3.LinuxĿ¼µÄ´´½¨Óëɾ³ýÃüÁî
¡¡¡¡4.LinuxÎı¾´¦ÀíÃüÁî
¡¡¡¡5.Linux±¸·ÝÓëѹËõÃüÁî
¡¡¡¡6.ÔÚLinux»·¾³ÏÂÔËÐÐDOSÃüÁî
¡¡¡¡7.Linux¸Ä±äÎļþ»òĿ¼µÄ·ÃÎÊȨÏÞÃüÁî
¡¡¡¡8.LinuxÓëÓû§ÓйصÄÃüÁî
¡¡¡¡9.Linuxϵͳ¹ÜÀíÃüÁî
¡¡¡¡10.
Linux´ÅÅ̹ÜÀí
¡¡¡¡11.LinuxÆäËüÃüÁî
1.Linux½øÈëÓëÍ˳öϵͳ
½øÈëLinuxϵͳ£º
±ØÐëÒªÊäÈëÓû§µÄÕ˺ţ¬ÔÚϵͳ°²×°¹ý³ÌÖпÉÒÔ´´½¨ÒÔÏÂÁ½ÖÖÕʺţº
¡¡¡¡1£®root--³¬¼¶Óû§Õʺţ¨ÏµÍ³¹ÜÀíÔ±£©£¬Ê¹ÓÃÕâ¸öÕʺſÉÒÔÔÚϵͳÖÐ×öÈκÎÊÂÇé
¡£
¡¡¡¡2£®ÆÕͨÓû§--Õâ¸öÕʺŹ©ÆÕͨÓû§Ê¹Ó㬿ÉÒÔ½øÐÐÓÐÏ޵IJÙ×÷¡£
¡¡¡¡Ò»°ãµÄLinuxʹÓÃÕß¾ùΪÆÕͨÓû§£¬¶øÏµÍ³¹ÜÀíÔ±Ò»°ãʹÓ󬼶Óû§ÕʺÅÍê³ÉһЩϵͳ¹ÜÀíµÄ¹¤×÷¡£
Èç¹ûÖ»ÐèÒªÍê³ÉһЩÓÉ ......
LinuxϵͳÖгÌÐòµÄÏß³Ì×ÊÔ´ÊÇÓÐÏ޵쬱íÏÖΪ¶ÔÓÚÒ»¸ö³ÌÐòÆäÄÜͬʱÔËÐеÄÏß³ÌÊýÊÇÓÐÏ޵ġ£¶øÄ¬ÈϵÄÌõ¼þÏ£¬Ò»¸öÏ߳̽áÊøºó£¬Æä¶ÔÓ¦µÄ×ÊÔ´²»»á±»ÊÍ·Å£¬ÓÚÊÇ£¬Èç¹ûÔÚÒ»¸ö³ÌÐòÖУ¬·´¸´½¨Á¢Ị̈߳¬¶øÏß³ÌÓÖĬÈϵÄÍ˳ö£¬Ôò×îÖÕÏß³Ì×ÊÔ´ºÄ¾¡£¬½ø³Ì½«²»ÔÙÄܽ¨Á¢ÐµÄÏ̡߳£
½â¾öÕâ¸öÎÊÌ⣬ÓÐ2ÖÖ·½Ê½£¬ÏµÍ³×Ô¶¯ÊÍ·ÅÏß³Ì×ÊÔ´£¬»òÕßÓÉÁíÒ»¸öÏß³ÌÊͷŸÃÏß³Ì×ÊÔ´¡£
×¢Ò⣬ÔÚÕâÀÎÒÈÏΪ½ø³ÌÔËÐк󣬱¾Éí£¬Ò²ÊÇÒ»¸öỊ̈߳¬Ö÷Ị̈߳¬Ö÷Ï̺߳ÍÖ÷Ï߳̽¨Á¢µÄÏ̹߳²Ïí½ø³Ì×ÊÔ´¡£²»Í¬ÓÚÆäËûỊ̈߳¬ÔÚÓÚÖ÷Ïß³ÌÔËÐнáÊøºó£¬³ÌÐòÍ˳ö£¬ËùÓгÌÐò½¨Á¢µÄÏß³ÌÒ²»áÍ˳ö¡£
ϵͳ×Ô¶¯ÊÍ·Å
Èç¹ûÏëÔÚÏ߳̽áÊøÊ±£¬ÓÉϵͳÊÍ·ÅÏß³Ì×ÊÔ´£¬ÔòÐèÒªÉèÖÃÏß³ÌÊôÐÔΪdetach¡£
´úÂëÉÏ£¬¿ÉÒÔÕâÑù±íʾ£º
pthread_t t;
pthread_attr_t a; //Ïß³ÌÊôÐÔ
pthread_attr_init(&a); //³õʼ»¯Ïß³ÌÊôÐÔ
pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED); //ÉèÖÃÏß³ÌÊôÐÔ
::pthread_create( &t, &a, GetAndSaveAuthviewSDRStub, (void*)lp); ......
ϵͳ
# uname -a # ²é¿´ÄÚºË/²Ù×÷ϵͳ/CPUÐÅÏ¢
# head -n 1 /etc/issue # ²é¿´²Ù×÷ϵͳ°æ±¾
# cat /proc/cpuinfo # ²é¿´CPUÐÅÏ¢
# hostname # ²é¿´¼ÆËã»úÃû
# lspci -tv # ÁгöËùÓÐPCIÉ豸
# lsusb -tv # ÁгöËùÓÐUSBÉ豸
# lsmod # Áгö¼ÓÔØµÄÄÚºËÄ£¿é
# env # ²é¿´»·¾³±äÁ¿
×ÊÔ´
# free -m # ²é¿´ÄÚ´æÊ¹ÓÃÁ¿ºÍ½»»»ÇøÊ¹ÓÃÁ¿
# df -h # ²é¿´¸÷·ÖÇøÊ¹ÓÃÇé¿ö
# du -sh <Ŀ¼Ãû> # ²é¿´Ö¸¶¨Ä¿Â¼µÄ´óС
# grep MemTotal /proc/meminfo # ²é¿´ÄÚ´æ×ÜÁ¿
# grep MemFree /proc/meminfo # ²é¿´¿ÕÏÐÄÚ´æÁ¿
# uptime # ²é¿´ÏµÍ³ÔËÐÐʱ¼ä¡¢Óû§Êý¡¢¸ºÔØ
# cat /proc/loadavg # ²é¿´ÏµÍ³¸ºÔØ
´ÅÅ̺ͷÖÇø
# mount | column -t # ²é¿´¹Ò½ÓµÄ·ÖÇø×´Ì¬
# fdisk -l # ²é¿´ËùÓзÖÇø
# swapon -s # ²é¿´ËùÓн»»»·ÖÇø
# hdparm -i /dev/hda # ²é¿´´ÅÅ̲ÎÊý(½öÊÊÓÃÓÚIDEÉ豸)
# dmesg | grep IDE # ²é¿´Æô¶¯Ê±IDEÉ豸¼ì²â×´¿ö
ÍøÂç
# ifconfig ......
ij¸öÈÕ¼ûÖØÒªµÄÍøÂçоƬ¹«Ë¾¼´½«ÊÕ¹ºÒ»¼Ò×îÔçµãÉÌÒµ»¯Ç¶ÈëʽLinux µÄ¹«Ë¾¡£ Cavium ¹«Ë¾ÒÑͬÒâÖ§¸¶5000 ÍòÃÀÔª¸øÒѾ¶ÀÁ¢ÔËÐÐÊ®ÄêÖ®¾ÃµÄ MontaVista ¹«Ë¾¡£
ÕâÊǽñÄêµÚ¶þÀýǶÈëʽLinux ²Ù×÷ϵͳ¡¢¹¤¾ß¼°·þÎñÊг¡µÄ²¢¹º°¸Àý¡£µÚÒ»ÀýÊÇÔÚ½ñÄêÎåÔ£¬µ±Ê±Ó¢Ìضû»¨·Ñ 88400 ÍòÃÀÔªÊÕ¹º Wind River ϵͳ¹«Ë¾¡£ÈçͬWind River ÊÕ¹º°¸Ò»Ñù£¬ MontaVista ¹«Ë¾Éù³ÆÊÕ¹ººó½«±£ÁôÆäÉ̱êÃû³Æ£¬²¢¼ÌÐø¶ÀÁ¢ÔËÐС£
ËÊÇ Cavium £¿
CaviumÊÇ»ùÓÚ MIPS64 ¼Ü¹¹¿Í»§ÑÜÉú°æ×îÖªÃûµÄ¶àºËÍøÂç´¦ÀíÆ÷³§ÉÌ¡£ÆäÆì½¢²úÆ· Octeon ´¦ÀíÆ÷¼Ò×å°üº¬µ¥ºËµ½Ê®ÁùºËµÈ¸÷ÖÖģʽ£¬ÆäÈí¼þ¼æÈÝÐÔºá¿çÕâЩƽ̨¡£×ÔÍøÂç½øÈëµ½ËùÓеÄÐÎʽºÍ´óСºó£¬ÕâÊÇÒ»¸ö¾Þ´óµÄÂôµã¡£ÔÚ´óÐÍÍøÂçµ±ÖУ¬ ÈçµçÐÅ»ù´¡ÉèÊ©£¬¸ßÃܶȺ͵ÍÄܺÄ/ ζȽáºÏ¶àºË¼Ü¹¹ÊÇÁíÒ»´óÁÁµã¡£½õÉÏÌí»¨µÄÊÇ£¬ Cavium µÄоƬ ³£»áÌṩºÜ¶à¶¨ÖÆÓ²¼þÒýÇæ £¬ÀýÈç´ÓÖ÷CPU ÖÐжÏ TCP/IP ´¦Àí¡¢¼ÓÃܺʹ洢´¦ÀíÈÎÎñ¡£
Cavium ±³ÒÀÂíÈøÖîÈûÖÝ£¬Éù³ÆÆä°ìÊ´¦Ëù¹ÍÓ¶µÄÖ÷Òª¹¤³Ìʦ¶¼ÊÇÀ´×Ô´ÓǰDEC ¹«Ë¾´«ËµÖÐµÄ Alpha оƬÍŶӡ£¸Ã¹«Ë¾Ò²±£ÁôÁË´óÁ¿Ó¡¶ÈµÄÑз¢»ú¹¹¡£
ËÊÇ MontaVista £¿
MontaVista ÔÚ“õçõÇѧ²½”Öгɹ¦µØ×ß¹ýÁ˹ýȥʮÄê¡£2003 Ä꣬ ......
Linux .bash_profileÖÐ umask 022 ÉèÖÃÎÊÌâ
===========================================================
×÷Õß: tolywang(http://tolywang.itpub.net)
·¢±íÓÚ:2008.06.21 09:46
·ÖÀà: Linux/Unix¹ÜÀí
³ö´¦£ºhttp://tolywang.itpub.net/post/48/464765
---------------------------------------------------------------
ORACLE_BASE=/u01/product;export ORACLE_BASE
ORACLE_TERM=vt100;export ORACLE_TERM
PS1=`hostname`'<$PWD>$';export PS1
EDITOR=/bin/vi; export EDITOR
ORA_NLS33=/u01/product/oracle/ocommon/nls/admin/data;export ORA_NLS33
CLASSPATH=/u01/product/oracle/jdbc/lib/classesl11.zip:/usr/local/java;
export DISPLAY=127.0.0.1:0.0
export LD_ASSUME_KERNEL=2.4.1
PATH=$ORACLE_HOME/bin:$PATH:.; export PATH
umask 022
alias ll='ls -l';
alias ls='ls --color';
ÎÒÃÇÔÚLinuxϵͳϰ²×°OracleÊý¾Ý¿âµÄʱºò£¬ÉèÖÃOracleÓû§µÄprofile , .bash_profile ÎļþÖÐÉèÖÃÓÐ umask 022 , ÊÇ×÷ʲôÓõÄÄØ £¿
$ umask 022
umask
¹¦ÄÜ˵Ã÷£ºÖ¸¶¨ÔÚ½¨Á¢ÎļþʱԤÉèµÄȨÏÞÑÚÂë¡£
Óï¡¡¡¡·¨£ºumask [-S][ȨÏÞÑÚÂë]
²¹³äË ......
×î½ü×öµÄ¶«Î÷»¹ÕæÊÇÔÓÂÒÎÞÕÂ, Óеã¸ú²»ÉϽø¶È,½Ó´¥µÄ¶¼ÊÇδ֪µÄ¶«Î÷.¼ÌÐøÀ©³ä..
alarm£¨ÉèÖÃÐźŴ«ËÍÄÖÖÓ£©
Ïà¹Øº¯Êý signal£¬sleep
±íÍ·Îļþ #include<unistd.h>
¶¨Ò庯Êý unsigned int alarm(unsigned int seconds);
º¯Êý˵Ã÷ alarm()ÓÃÀ´ÉèÖÃÐźÅSIGALRMÔÚ¾¹ý²ÎÊýsecondsÖ¸¶¨µÄÃëÊýºó´«Ë͸øÄ¿Ç°µÄ½ø³Ì¡£Èç¹û²ÎÊýseconds Ϊ0£¬Ôò֮ǰÉèÖõÄÄÖÖӻᱻȡÏû£¬²¢½«Ê£ÏµÄʱ¼ä·µ»Ø¡£
·µ»ØÖµ·µ»ØÖ®Ç°ÄÖÖÓµÄÊ£ÓàÃëÊý£¬Èç¹û֮ǰδÉèÄÖÖÓÔò·µ»Ø0¡£
·¶Àý #include<unistd.h>
#include<signal.h>
void handler() {
printf("hello\n");
}
main()
{
int i;
signal(SIGALRM,handler);
alarm(5);
for(i=1;i<7;i++){
printf("sleep %d ...\n",i);
sleep(1);
}
}
Ö´ÐÐ sleep 1 ...
sleep 2 ...
sleep 3 ...
sleep 4 ...
sleep 5 ...
hello
sleep 6 ...
¡¡
kill£¨´«ËÍÐźŸøÖ¸¶¨µÄ½ø³Ì£©
Ïà¹Øº¯Êý raise£¬signal
±íÍ·Îļþ #include<sys/types.h>
#include<signal.h>
¶¨Ò庯Êý int kill(pid_t pid,int sig);
º¯Êý˵Ã÷ kill()¿ÉÒÔÓÃÀ´ËͲÎÊýsigÖ¸¶¨µÄÐźŸø²ÎÊýpidÖ¸¶¨µÄ½ø³Ì¡£²ÎÊýpidÓм¸ÖÖÇé¿ö:
pid>0 ½«Ðź ......