ûÉÏÉÏʲôºÃ´óѧ!Ñ¡ÔñÁ˼ÆËã»úרҵ-ѧϰWIN2003-±ÏÒµÁË-ʧÍûÁË(ûһ¸öÏñÑùµÄ¹¤×÷555)
WINDOWDSÏÂÈ˲ÅÒѾ¹ýÊ£ÁË,ÎÒÑ¡ÔñÁËLINUX¿ÝÔïµÄϵͳ(ÒÔÇ°ÊÇÕâôÏëµÄ).ÏëѧºÃLINUX µÄ¸ø´ó¼Ò¼¸µã½¨Òé!
¡¡¡¡Ê×ÏÈÏ£ÍûÏëѧLinuxµÄÅóÓÑÄܹ»Íü¼ÇWindows2000£¬×îÆðÂëÍü¼ÇWindowsϵÄÅÌ·û¡¢Ó¦ÓóÌÐòµÈ»ù´¡µÄ¶«Î÷£¬Æä´ÎÒªÉî¿ÌÃ÷°×Linux ºÍWindowsÊÇ2¸ö²»Í¬µÄϵͳƽ̨£¬¿ÉÒÔÈ¥¶Ô±È×Åѧϰ£¬µ«²»ÒªÖ±½ÓÄÃWindowsÄÇÌ׶«Î÷Ö±½ÓÌ×Óõ½LinuxѧϰÖС£
¡¡¡¡Ñ§Ï°¼¸µã·½Ïò(¾ÍÒµ·½Ïò):
¡¡¡¡Ò»¡¢×ÀÃæϵͳ
¡¡¡¡¶þ¡¢ÄÚºËÔ´´úÂëѧϰ¡£
¡¡ Èý¡¢ÏµÍ³¹ÜÀí
ËÄ¡¢Ó¦Óÿª·¢
Îå¡¢·þÎñÆ÷ÁìÓò
Áù¡¢ÏµÍ³¼¯³É
ÎÒµÄLINUX ֮·!!!!!!!!!(¶þ)
Linux ϵͳÃüÁָͨÄÏ(³õ¼¶)
Ëæ×ÅLinuxÔÚÎÒ¹úµÄ³ÖÐøÉýΣ¬ÏëѧϰËüµÄÈËÒ²Ô½À´Ô½¶à¡£µ«ÊǾø´ó¶àÊýµÄÈËÔçÒÑÏ°¹ßÁËɵ¹Ïʽ²Ù×÷µÄWindows£¬ÒªËûÃÇÒ»ÏÂ×Ó¾ÍÊÊÓ¦LinuxµÄ²Ù×÷£¬È·ÊµÓкܴóµÄÀ§ÄÑ¡£ÌرðÊÇÎÞÊýµÄLinuxÃüÁ¶ÔÓÚÄÇЩÁ¬DOS¶¼Ã»ÓнӴ¥¹ýµÄÈËÀ´Ëµ£¬ÊµÔÚÊDz»¿ÉÈÌÊÜ£¬Õâ¾ÍΪLinuxÔÚÎÒ¹úµÄÍƹã´øÀ´Á˺ܴóµÄ¾ÖÏÞÐÔ¡£Òò´ËÔÚ¾ø´ó¶àÊýÇé¿öÏ£¬Linux¶¼ÊÇÒÔÒ»Öָ߶˲Ù×÷ϵͳµÄ×Ë̬³öÏÖÔÚÎÒÃÇÃæÇ°¡£ºÃÔÚ½ü¼¸ÄêÎÒ¹úÕþ¸®µÄ´óÁ¦Ö§³Ö£¬ÒÔ¼°ÊÀ½ç¸÷Ó²¼þºÍÈí¼þ³§ÉÌÔÚÎÒ¹ú¶ÔLinuxµÄ´óÁ¦Íƹ㣬LinuxÒѾȡµÃÁ˺ܴóµÄ³É¹¦¡£¶øÇÒ¾ø´ó¶àÊý°æ±¾µÄLinux¶¼ÒѾ֧³ÖÖÐÎÄ¡£¸ü¿ÉϲµÄÊÇËüµÄX WindowsÒ²ÒѾ×öµÃ·Ç³£Æ¯ÁÁʵÓã¬Õâ¶ÔÓÚ¸Õ´ÓWindowsתÏòLinuxѧϰµÄÈËÀ´Ëµ£¬²»µ«½µµÍÁËѧϰµÄÃż÷£¬¶øÇÒÓÐÖúÓÚÌá¸ßËûÃÇѧϰLinux µÄ»ý¼«ÐÔ¡£ÔÚX WindowsÏÂÎÒÃÇÒѾ¿ÉÒÔÍê³É´ó¶àÊýµÄ²Ù×÷£¬Ö»ÐèÓÃÃüÁîÀ´Íê³ÉÉÙÁ¿µÄ¹¤×÷¡£Õâ¶ÔÓÚLinuxµÄѧϰÓкܴóµÄ°ïÖú¡£±¾ÎľÍÒÔʹÓÃ×î¹ã·ºµÄRedHat LinuxΪÀý¸ø´ó¼Ò½²Ò»½²LinuxµÄ»ù±¾ÅäÖá£
1¡¢Ìí¼ÓÓû§
¡¡¡¡Ð°²×°µÄLinuxÒ»°ãÖ»ÓÐÒ»¸öÓû§£¬¼´¸ùÓû§£¬Ò²¾ÍÊÇϵͳ¹ÜÀíÔ±¡£Ëû¶ÔϵͳÓÐÎÞÏÞµÄȨÁ¦£¬¿ÉÒÔ¸ü¸Ä»òɾ³ýÈÎÒâÎļþ£¬Òò´ËÉÔÓв»É÷¾Í¿ÉÄÜÆÆ»µÏµÍ³¡£±ÈÈçrootÖ»ÒªÊäÈëÒ»Ìõ¼òµ¥µÄÃüÁî¡°rm -fr /¡±¾Í¿ÉÒÔɾ³ýϵͳÄÚµÄËùÓÐÎļþ£¬ÆäÖС°rm¡±¼´É¾³ýÎļþÃüÁ¡°-f¡±²ÎÊý¼´Ç¿ÖÆ£¬¡°-r¡±ÓÃÓÚɾ³ýÖ¸¶¨Ä¿Â¼ÖеÄÎļþ£¬¡°/¡±¾ÍÊÇÖ¸¸ùĿ¼£¬ÕûÌõÃüÁî¾ÍÊÇÇ¿ÖÆɾ³ýϵͳÖÐËùÓÐÎļþ£¬¿É¼ûÆäÆÆ»µÐÔÖ®´ó¡£»¹ÓÐÆäËûµÄÎó²Ù×÷Ò²¿ÉÄܸøϵͳÔì³ÉÑÏÖصÄÆÆ»µ£¬Òò´ËΪÁË°²È«Æð¼û£¬Æ½³£µÄ²Ù×÷ÎÒÃÇ×îºÃ²»ÒªÒÔ¡°root¡±Éí·ÝµÇ¼£¬Õâ¾ÍÐèҪн¨Ò»¸öÓû§¡£Ð½¨Óû§¿ÉÒÔÔÚshellÏÂÓÃÃüÁî´´½¨£¬Ò²¿ÉÒÔÏñWindowsÒ»ÑùÔÚͼÐδ°¿ÚÖд´½¨¡£ÔÚshellÏÂÖ»ÒªÒ»Ìõ¼òµ¥µÄÃüÁî¾Í¿ÉÒÔ´´½¨Ò»¸öÓû§¡£±ÈÈçн¨Óû§Îªtext£¬ÎÒÃÇÖ»Òª°´Èçϲ½Öè²Ù×÷¼´¿É£ºÔÚ×ÀÃæµ¥»÷ÓÒ¼ü£¬Ñ¡Ôñ¡°Ð½¨Öնˡ±¼´½øÈëshell£¬È»ºóÊäÈë ¡°adduser text¡±°´»Ø³µ¼üºó£¬ÔÙÊäÈë¡°passwd text¡±»Ø³µ£¬°´Ìáʾ¼üÈëÃÜÂë¼´´´½¨ÁËÐÂÓû§¡°text¡±¡£
Èç¹ûÒªÔÚͼÐλ¯´°¿ÚÖд´½¨ÐÂÓû§£¬Ë«»÷×ÀÃæÉϵġ°´ÓÕâÀ↑ʼ¡±Í¼±ê£¬ÔÚ´ò¿ªµÄ´°¿ÚÖеã»÷¡°ÏµÍ³ÉèÖá±£¬È»ºóµã»÷¡°Óû§ºÍ×éȺ¡±,ÔÚµ¯³öµÄ¡°RedHat Óû§¹ÜÀíÆ÷¡±Öеã»÷¡°Ìí¼ÓÓû§¡±¾Í¿ÉÒÔн¨Óû§ÁË¡£½¨ºÃÓû§ÒԺ󣬾ͿÉÒÔÓÃн¨µÄ¡°text¡±ÕÊ»§µÇ¼ÁË¡£ÒÔºóÈç¹ûÔÚ shellÏÂÐèÒªÓõ½ rootȨÏÞ£¬Ö»ÒªÊäÈë¡°su¡±ÃüÁîÔٻسµ£¬È»ºóÊäÈërootµÄÃÜÂ룬¾Í¿ÉÒÔÔÝʱÒÔrootÉí·Ý½øÐвÙ×÷ÁË¡£
2.¹ÒÔØÈíÅ̺͹âÅÌ
¡¡¡¡LinuxÔÚʹÓÃÈíÅ̺͹âÅÌ֮ǰ£¬±ØÐëÏȹÒÔØËü¡£ÏÖÔÚ´ó¶àÊý°æ±¾µÄLinux¶¼¿ÉÒÔ×Ô¶¯¹ÒÔØÈíÅ̺͹âÅÌ£¬Èç¹û°æ±¾±È½ÏÀÏ£¬²»Ö§³Ö×Ô¶¯¹ÒÔØÈíÅ̺͹âÅ̵Ļ°£¬¾ÍÐèÊÖ¶¯¹ÒÔØËü¡£¹ÒÔØÎÒÃÇÓá°mount¡±ÃüÁî¡£ÔÚ×ÀÃæµã»÷ÓÒ¼ü£¬Ñ¡Ôñ¡°Ð½¨Öնˡ±´ò¿ªshell£¬ÊäÈë¡°su¡±ÃüÁîºÍ root ÃÜÂëÈ¡µÃrootȨÏÞºó£¬ÔÙ¼üÈë¡°mount /mnt/floppy¡±ÃüÁî¾Í½«ÈíÅ̹ÒÔص½ÁË¡°/mnt¡±Ä¿Â¼Ï¡£Ö®ËùÒÔÑ¡Ôñ¹ÒÔØÔÚ¡°/mnt¡±Ä¿Â¼Ï£¬ÊÇÒòΪLinux½«¡°/mnt¡±Ä¿Â¼ÓÃÀ´´æ·ÅÁÙʱӳÏñÎļþ¡£¹ÒÔØÈíÅ̺ó£¬ÎÒÃǾͿÉÒÔ½øÈëµ½¡°/mnt¡±Ä¿Â¼Ï¶ÔÈíÅ̽øÐжÁд²Ù×÷ÁË¡£¹âÅ̵ĹÒÔØÖ»Òª¼üÈë¡°mount /mnt/cdrom¡±¼´¿É¡£µ«³õѧÕß±ØÐë×¢ÒâµÄÊÇ£¬´Ë´¦¹ÒÔصÄÊǹâÅ̺ÍÈíÅÌ£¬¶ø²»ÊǹâÇýºÍÈíÇý£¬Èç¹ûÒª¸ü»»¹âÅ̾ͱØÐëÏÈжÔØ£¬·ñÔò¹âÅ̾ͻᱻϵͳËøס£¬ÄÄŽèÖú½ô¼±³ö´´¿×Ò²µ¯²»³ö¹âÅÌ¡£ÒªÐ¶ÔعâÅÌ£¬Ö»Ðè¼üÈë¡°umount /mnt/cdrom¡±ÃüÁî¼´¿É¡£
3.ͨÓÃÃüÁî
´Ó¼¼ÊõÉϽ²£¬Uname¡¢diff¡¢date¡¢sort ºÍ uniq Ó¦¸Ã¿´×÷ÎļþÃüÁµ«ÓÉÓÚËüÃǾ³£ÓÃÓÚÕï¶ÏºÍά»¤Àý³ÌµÄϵͳ¹ÜÀí·½Ã棬ÔÚÕâÀï½âÊÍËüÃǸüÓÐÒâÒå¡£
Uname
Uname ÌṩÁ˳£¹æϵͳÐÅÏ¢¡£µ±Ö¸¶¨ -a Ñ¡Ïîʱ£¬ÏÔʾËùÓпÉÓÃÐÅÏ¢£º
$ uname -a
Linux linux 2.4.18-4GB #1 Wed Mar 27 13:57:05 UTC 2002 i686 unknown
ÔÚÕâÀïÎÒÃÇ´Ó×óÏòÓÒ¿´µ½³£¹æµÄϵͳÐÅÏ¢¡£Ã¿ÌõÐÅÏ¢¶¼ÓÐ×Ô¼ºµÄÑ¡ÏÔÚÏÂÃæµÄÔ²À¨ºÅÖУ©£¬¿ÉÒÔµ¥¶ÀÏÔʾ£º
²Ù×÷ϵͳÃû³ÆΪ Linux(-s)¡£
±¾»úµÄÍøÂç½ÚµãÃûΪ linux (-n)¡£
²Ù×÷ϵͳ·¢²¼°æ±¾Îª 4.5.18-4GB (-r)¡£
²Ù×÷ϵͳ°æ±¾Îª #1 Wed Mar 27 13:57:05 UTC 2002 (-v)¡£
»úÆ÷ÀàÐÍΪ i686 (-m)¡£
ÕâÀïµÄ´¦ÀíÆ÷ÀàÐÍ (-p) Ϊδ֪¡£
Diff ºÍ Date¡£¹ËÃû˼Ò壬Diff ±È½ÏÁ½¸öÎļþ¡£Ëü·µ»ØÄÇЩµ¼ÖÂÎļþ²»Í¬µÄÐУ¬²¢·µ»Ø¹ØÓÚÈçºÎʹÎļþ±äµÃÏàͬµÄһЩº¬ÒåÒþ»ÞµÄÊä³ö£º
$ diff test.out test2.out
0a1
> Another test.
ÔÚÕâÀïÎÒÃDZ»¸æÖª£¬ÐèÒª½« "Another test." ÕâÒ»ÐÐÌí¼Óµ½ test.out£¬ÒÔ±ãʹËüÓë test2.out ÏàËÆ¡£µÚÒ»¸ö×Ö·û "0" ÊÇÒªÔÚ test.out Öб༵ÄÐкţ»"a" ±íʾ¸ÃÐÐÓ¦¸Ã±»Ìí¼Óµ½ test.out£¬ÒÔ±ãÓë test2.out µÄµÚÒ»ÐÐ "1" ÏàÆ¥Åä¡£Èç¹ûÎÒÃÇÐèÒª¸ü¸Ä test.out£¬ÔòµÚ¶þ¸ö×Ö·ûÒ²¿ÉÒÔÊÇ "c"£¬¶øÈç¹ûÎÒÃÇÐèÒª´Ó test.out ÖÐɾ³ýһЩÄÚÈÝ£¬ÔòµÚ¶þ¸ö×Ö·ûÊÇ "d"¡£
Äú¿ÉÄÜÏ£Íûʹһ¸öÎļþÓëÁíÒ»¸öÎļþÏàËÆ£¬ÒÔ±ãΪijЩ´úÂëÌṩ²¹¶¡¡£diff »¹¾³£×÷Ϊ·ÖÎö¹¤¾ß£¬ÓÃÓÚÑéÖ¤³ÌÐò»ò½Å±¾ -- ÀýÈç sed ½Å±¾ -- µÄÊä³öÊÇ·ñÊÇËùÔ¤ÆÚµÄÊä³ö¡£
date ÃüÁî¿ÉÓÃÓÚÏÔʾ»òÉèÖÃÈÕÆÚ¡£Èç¹ûÓû§¾ßÓг¬¼¶Óû§È¨ÏÞ£¬ÔòËû»òËý¿ÉÒÔͨ¹ýÔÚÒÔÏÂÃüÁîÖÐÌṩһ¸öÊý×ÖÐÍ×Ö·û´®À´ÉèÖÃÈÕÆÚ£º
$ date 0101010004
´ËÃüÁÈÕÆÚÉèÖÃΪ 2004 Äê (04) 1 Ô 1 ÈÕ (0101) Á賿 1 ʱ (0100)¡£
µ«ÊÇ£¬ÈκÎÓû§¿ÉÒÔÓÃËùÐèµÄ¸ñʽÀ´ÏÔʾÈÕÆÚ¡£×¢ÒâÔÚ¸ñʽÐòÁÐ֮ǰÐèÒªÒ»¸ö¼ÓºÅ "+"¡£Èç¹ûûÓгöÏÖ´ËÃüÁîµÄÔ¤ÆÚÊä³ö£¬Ôò³¢ÊÔ½«Ëü°üº¬ÔÚµ¥ÒýºÅÖУº
$ date +'%H%M%S'
204748Äú¿ÉÒÔÔÚÐòÁÐÖаüº¬¿Õ¸ñ£¬ÕâʱÄúÐèҪʹÓÃË«ÒýºÅ£º
$ date +"%H %M %S"
20 47 51
Sort ÁпÉÒÔÓÃÁ½ÖÖ²»Í¬µÄ¸ñʽָ¶¨¡£Èç¹ûʹÓà -k Ñ¡ÏÔòÁеÄλÖÃ´Ó 1 ¿ªÊ¼½øÐбàºÅ¡£Äú»¹¿ÉÒÔʹÓà +POS1 ¸ñʽ£¬´ÓµÚÒ»ÁбàºÅΪÁ㿪ʼ½øÐÐÁеıàºÅ¡£ÒÔÏÂÁ½¸öÃüÁî²úÉúÏàͬµÄÊä³ö£º
$ ls -l *.out | sort +5 -7
$ ls -l *.out | sort -k 6,8
-rw-r--r-- 1 bluher users 375 Dec 5 2002 fdisk.out
-rw-r--r-- 1 bluher users 2447 Dec 28 20:15 ls.out
-rw-r--r-- 1 bluher users 590 Jan 4 21:24 greps.out
-rw-r--r-- 1 bluher users 78 Jan 4 21:25 sgrep.out
ÎÒµÄLINUX ֮·!!!!!!!!!(Èý)!
´ÅÅÌÐÅÏ¢
ÎÞÂÛÄúÊÇά»¤×Ô¼ºµÄϵͳ»¹ÊÇÖ§³Ö¾ßÓкܶàÓû§µÄÆóÒµ£¬¼àÊÓ´ÅÅ̿ռ䶼ÊÇϵͳ¹ÜÀíÔ±¸üÖØÒªµÄÖ°ÔðÖ®Ò»¡£du¡¢df ºÍ fdisk ÃüÁîÌṩÁË¿ÉÓôÅÅÌ¿Õ¼äµÄ²»Í¬ÊÓͼ¡£
du ÃüÁîÌṩ¶Ôÿ¸öĿ¼µÄÎļþ¿Õ¼äʹÓÃÇé¿öµÄÆÀ¹À¡£ÔÚĬÈÏÇé¿öÏ£¬²âÁ¿µÄµ¥Î»ÊÇ¿éµÄÊýÄ¿£¬¿éµÄ´óСͨ³£ÔÚ°²×°ÄúµÄϵͳʱȷ¶¨¡£
ÔÚÒÔϵÄʾÀýÖУ¬ÏµÍ³ÊÇʹÓÃ
1024 ×ֽڵĿ鰲װµÄ¡£Èç¹ûûÓÐÖ¸¶¨Ä¿Â¼£¬Ôò du ¿ªÊ¼¶Ôµ±Ç°Ä¿Â¼½øÐмÆËã¡£-h Ñ¡ÏîÒÔÒ×ÓÚ¶Á¶®µÄÐÎʽÌṩ´óСµÄÖµ£º
$ du -h Documents
105k Documents/jj
573k Documents/John
682k Documents
¿ÉÒÔʹÓà -a Ñ¡Ïî¸ü¸ÄÊä³ö£¬¸ÃÑ¡Ïîָʾ du ÏÔʾÎļþºÍĿ¼µÄ¿éÊý¡£Ñ¡Ïî --block-size=SIZE ָʾ du ÒÔ SIZE ËùÖ¸¶¨×Ö½Ú´óСµÄ¿éµÄÊýÄ¿À´ÏÔʾÊä³ö¡£
$ du --block-size=512 Documents
209 Documents/jj
1146 Documents/John
1363 Documents
ÔÚĬÈÏÇé¿öÏ£¬du »¹ÎªÃ¿¸ö×ÓĿ¼µÝ¹éµØ´òÓ¡ÐÅÏ¢¡£Í¨¹ýʹÓà max-depth=N Ñ¡Ïî¿ÉÒÔÏÞÖÆÕâÖÖ²Ù×÷£¬ÆäÖÐ N µÈÓÚ±»±¨¸æµÄ×î´ó¼¶Êý£º
$ du --max-depth=2 .
$ du --max-depth=2 | sort -n
4 ./.xemacs
4 ./public_html
105 ./Documents/jj
573 ./Documents/Ian
682 ./Documents
2420 ./jdevhome/system
8350 ./jdevhome/system9.0.3.1035
13483 ./jdevhome/mywork
24252 ./jdevhome
...
du ±¨¸æĿ¼ºÍ×ÓĿ¼µÄ¿Õ¼äʹÓÃÇé¿ö£¬¶ø df ±¨¸æÒÑ°²×°ÎļþϵͳµÄ´ÅÅÌ¿Õ¼äʹÓÃÇé¿ö£º
$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda6 4195632 1983656 2211976 48% / /dev/hda5 14607 3778 10075 28% /boot
/dev/hda9 937372 494028 443344 53% /home
/dev/hda8 6297248 3876880 2420368 62% /opt
shmfs 256220 0 256220 0% /dev/shm
ÔÚÕâÀdf ±¨¸æÁËÎå¸öÎļþϵͳµÄ״̬¡£Óë du ÀàËÆ£¬df ÀûÓà -h Ñ¡ÏîÌṩÈËÀà¿É¶ÁµÄÊä³ö£º
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda6 4.0G 1.9G 2.1G 48% / /dev/hda5 14M 3.7M 9.8M 28% /boot
/dev/hda9 915M 476M 440M 52% /home
/dev/hda8 6.0G 3.7G 2.3G 62% /opt
shmfs 250M 0 250M 0% /dev/shm
df ÃüÁÔÊÐíÄúÀûÓà -block-size=SIZE Ñ¡ÏîÀ´Ö¸¶¨¿éµÄ´óС¡£
fdisk ÃüÁîÊÇ Linux µÄ·ÖÇø±í²Ù×÷ÃüÁî¡£Óë du ºÍ df ²»Í¬£¬Ã»ÓÐ root Óû§È¨ÏÞʱ²»ÄÜÔËÐиÃÃüÁî¡£Èç¹ûÖ¸¶¨ÁË -l Ñ¡ÏÔò¿ÉÒÔ½«Ëü½öÓÃÓÚ±¨¸æµÄÄ¿µÄ¡£ËüÌṩÁËÄúµÄÕû¸ö·ÖÇø±íµÄÍêÕûÊÓͼ£¬¶ø²»½ö½öÊÇÄúʹÓà df Ëù¿´µ½µÄÀ©Õ¹ Linux ·ÖÇø£º
# fdisk -l
Disk /dev/hda:240 heads, 63 sectors, 1940 cylinders
Units = cylinders of 15120 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 286 2162128+ c Win95 FAT32 (LBA)
/dev/hda2 * 288 1940 12496680 5 Extended
/dev/hda5 288 289 15088+ 83 Linux
/dev/hda6 290 844 4195768+ 83 Linux
/dev/hda7 845 983 1050808+ 82 Linux swap
/dev/hda8 984 1816 6297448+ 83 Linux
/dev/hda9 1817 1940 937408+ 83 Linux
½ø³Ì¼àÊÓ
ÔÚ·±Ã¦µÄ¶àÓû§ÏµÍ³ÖУ¬½ø³Ì¼àÊÓÒ²ÊÇ Linux ϵͳ¹ÜÀíÔ±µÄÒ»ÏîÖØÒªÖ°Ôð¡£ÔÚÕâ·½Ã棬ps ºÍ top ÊÇÁ½¸ö×îÓÐÓõÄÃüÁî¡£
ps ÃüÁîÌṩÁ˵±Ç°ÔËÐнø³ÌµÄ¿ìÕÕ¡£
ÒÔÏÂÊÇ ps µÄ×î¼òµ¥ÐÎʽ£º
$ ps
PID TTY TIME CMD
3884 pts/1 00:00:00 bash
3955 pts/2 00:00:00 more
3956 pts/5 00:00:05 sqlplus
PID Êǽø³ÌµÄ±êʶºÅ¡£
TTY Êǽø³ÌËùÊôµÄÖն˿ØÖÆ̨¡£
TIME ÁÐÊǽø³ÌËùʹÓõÄ×ÜµÄ CPU ʱ¼ä¡£
CMD ÁÐÁгöÕýÔÚÖ´ÐеÄÃüÁîÐС£
ʹÓôøÓÐ -ef Ñ¡ÏîµÄ ps£¬·µ»ØϵͳÖÐËùÓÐÓû§µÄËùÓнø³ÌµÄÍêÕûÁÐ±í¡£Èç¹ûÄú½«´Ë ps ÃüÁîµÄ½á¹û´«Ë͵½ grep ÖУ¬Ôò¸Ã½á¹û¸üÒ×Óڲ鿴¡£ÀýÈ磺
$ ps -ef | grep oracle
UID PID PPID C STIME TTY TIME CMD
oracle 1633 1 0 13:58 ?00:00:00 ora_pmon_ora1
oracle 1635 1 0 13:58 ?00:00:00 ora_dbw0_ora1
oracle 1637 1 0 13:58 ?00:00:01 ora_lgwr_ora1
oracle 1639 1 0 13:58 ?00:00:02 ora_ckpt_ora1
oracle 1641 1 0 13:58 ?00:00:02 ora_smon_ora1
oracle 1643 1 0 13:58 ?00:00:00 ora_reco_ora1
oracle 1645 1 0 13:58 ?00:00:00 ora_cjq0_ora1
oracle 1647 1 0 13:58 ?00:01:18 ora_qmn0_ora1
oracle 1649 1 0 13:58 ?00:00:00 ora_s000_ora1
oracle 1651 1 0 13:58 ?00:00:00 ora_d000_ora1
×¢Ò⣬µ±Äú½« ps µÄÊä³ö´«Ë͵½ grep ÃüÁîʱ£¬ÁбêÌâ²¢²»ÏóÔÚ ps ÃüÁî±¾ÉíËùʹÓÃʱÄÇÑùÕý³£µØÏÔʾ¡£Îª±ãÓÚ˵Ã÷£¬±êÌâλÓÚÊä³öµÄÉÏ·½£¬ÒÔ±ãÇå³þµØÏÔʾÆäÁªÏµ¡£
ËäÈ» uid ͨ³£ÊÇÖ¸Êý×ÖÐ͵ıêʶ£¬µ«ÔÚµÚÒ»ÁÐÏÂÖ¸¶¨µÄÊÇÓû§Ãû£¬±ê¼ÇΪ UID¡£
PPID ÊǸ¸½ø³ÌµÄ±êʶºÅ¡£¶ÔÓÚ Oracle ½ø³Ì£¬ÕâÀïµÄ±êʶºÅΪ 1 -- ËüÊÇ init ½ø³Ì£¨ËùÓнø³ÌµÄ¸¸½ø³Ì£©µÄ id£¬ÒòΪÔÚ±¾ÏµÍ³Öа²×°µÄ Oracle ÊÇ×÷ΪµÇ¼½ø³ÌµÄÒ»²¿·Ö¶øÆô¶¯µÄ¡£
±êΪ C µÄÁÐÊÇÓÉ CPU ÓÃÓÚ¼ÆËãÖ´ÐÐÓÅÏȼ¶µÄÒò×Ó¡£
STIME ÊÇÖ¸½ø³ÌµÄÆô¶¯Ê±¼ä¡£
ÎʺűíʾÕâЩ½ø³Ì²»ÊôÓÚÈκΠTTY£¬ÒòΪËüÃÇÊÇÓÉϵͳÆô¶¯µÄ¡£
ÒÔÏÂÊÇ ps ÃüÁî´øÓÐijЩ²»Í¬Ñ¡ÏîµÄÁíÒ»¸öʾÀý¡£×¢Ò⣬ÆäÖкܶàÁÐÓëÖ´ÐдøÓÐ -ef Ñ¡ÏîµÄ ps ʱµÄÁÐÏàͬ£º
$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
bluh 4024 0.0 0.2 2240 1116 pts/1 S 20:59 0:00 su bluher
bluh 4025 0.0 0.3 2856 1668 pts/1 S 20:59 0:00 bash
bluh 4051 0.0 0.2 2488 1504 pts/1 R 21:01 0:00 ps aux
bluh 4052 0.0 0.1 1636 600 pts/1 S 21:01 0:00 grep bluher
³ýÁËÌṩÖØÒªµÄÕï¶ÏÐÅÏ¢£¬ps ÃüÁ¾³£ÓÃÓÚÕÒ³öʧ¿Ø½ø³ÌµÄ PID¡£ÀýÈ磬ÄúµÄÒ»¸öÓû§ÔÚ SQL*Plus »á»°ÖÐÊäÈëÒ»¸öµÑ¿¨¶ûÁª½Ó¡£Äú¿ÉÒÔÖ´ÐÐÒÔÏ嵀 ps ÃüÁîÀ´ÕÒ³öÆä PID£º
$ ps -ef | grep bluher
...
bluher 4068 4064 0 21:14 pts/6 00:00:00 less
bluher 4112 3945 0 21:28 pts/5 00:08:42 sqlplus
...
È»ºóÄú¿ÉÒÔʹÓÃÒÔÏÂÃüÁÆäÖÕÖ¹£º
$ kill 4112
³£¹æÓû§¿ÉÒÔ¿´µ½ËùÓеÄϵͳ½ø³Ì£¬µ«ËûÃÇÖ»ÄÜÖÕÖ¹ËûÃÇ×Ô¼ºÓµÓеĽø³Ì¡£
Ps ֻΪÄúÌṩµ±Ç°½ø³ÌµÄ¿ìÕÕ¡£Òª¼´Ê±²é¿´×î»îÔ¾µÄ½ø³Ì£¬¿ÉʹÓà top¡£Top ʵʱµØÌṩ½ø³ÌÐÅÏ¢¡£Ëü»¹ÓµÓн»»¥Ê½µÄ״̬£¬ÔÊÐíÓû§ÊäÈëÃüÁÈç n ºóÃæ¸úÓÐ 5 »ò 10 µÈÊý×Ö¡£Æä½á¹ûÊÇָʾ top ÏÔʾ 5 »ò 10 ¸ö×î»îÔ¾µÄ½ø³Ì¡£Top ³ÖÐøÔËÐУ¬Ö±µ½Äú°´ "q" Í˳ö top Ϊֹ¡£
ÒÔÏÂÊÇ top µÄ²¿·ÖÏÔʾ£º
8:14pm up 51 min, 7 users, load average: 0.02, 0.03, 0.05
96 processes:87 sleeping, 2 running, 0 zombie, 7 stopped
CPU states:6.4% user, 3.5% system, 0.0% nice, 89.9% idle
Mem:512440K av, 392288K used, 120152K free, 0K shrd, 55668K buff
Swap:1050800K av, 0K used, 1050800K free 236128K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
1289 root 18 0 78008 11M 1796 R 3.7 2.2 0:49 X
1965 bluher 20 0 12244 11M 10456 S 1.9 2.3 0:01 kdeinit
1986 bluher 18 0 996 996 768 R 1.5 0.1 0:00 top
1803 bluher 20 0 16960 16M 13508 S 0.9 3.3 0:03 kdeinit
1804 bluher 20 0 16964 16M 13508 S 0.9 3.3 0:03 kdeinit
1800 bluher 19 0 12260 11M 10076 S 0.1 2.3 0:04 kdeinit
1 root 20 0 220 220 188 S 0.0 0.0 0:04 init
...
¹Ø±Õ
¿´À´Ó¦¸ÃÒÔ shutdown ÃüÁîÀ´½áÊø±¾´ÎÌÖÂÛ¡£Óë±¾ÎÄÒÔ¼°ÉÏһƪÎÄÕÂÖÐËùÌÖÂÛµÄÐí¶àÃüÁîÒ»Ñù£¬Í¨³£ÓÐÒ»ÖÖ GUI ÐÎʽµÄÌæ´ú·½·¨¿ÉÒԹرÕÄúµÄϵͳ¡£µ«ÊÇ£¬µ±ÄúÐèÒªÊÖ¶¯¹Ø±Õʱ£¬Äú¿ÉÒÔʹÓÃÒÔÏÂÃüÁîÁ¢¼´½øÐйرգº
$ shutdown -h now
Äú¿ÉÒÔʹÓÃÒÔÏÂÃüÁîÊÖ¶¯µØÖØÐÂÆô¶¯ÏµÍ³£º
$ shutdown -r now
×¢ÒâÕâÁ½¸öÃüÁÐèÒªÖ¸¶¨Ê±¼ä¡£Äú¿ÉÒÔÖ¸¶¨ "now" »òʹÓôøÓÐʱ¼äÃëÊýµÄ -t Ñ¡Ïî¡£
ÎÒµÄLINUX ֮·!!!!!!!!!(ËÄ) ÃüÁîÏêϸ½éÉÜ£¡
ÆäʵѧϰLINUX ¾ÍÊÇѧϰÃüÁ¿´LINUXÍæµÄÔõôÑù¾Í¿´ÄãÃüÁî´òµÄÔõôÑù£¡
cat cd
chmod chown
cp cut
Ãû³Æ£ºcat
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£ºcat [-AbeEnstTuv] [--help] [--version] fileName
˵Ã÷£º°Ñµµ°¸´®Á¬½Óºó´«µ½»ù±¾Êä³ö£¨Ó©Ä»»ò¼Ó > fileName µ½ÁíÒ»¸öµµ°¸£©
²ÎÊý£º
-n »ò --number ÓÉ 1 ¿ªÊ¼¶ÔËùÓÐÊä³öµÄÐÐÊý±àºÅ
-b »ò --number-nonblank ºÍ -n ÏàËÆ£¬Ö»²»¹ý¶ÔÓÚ¿Õ°×Ðв»±àºÅ
-s »ò --squeeze-blank µ±Óöµ½ÓÐÁ¬ÐøÁ½ÐÐÒÔÉϵĿհ×ÐУ¬¾Í´ú»»ÎªÒ»ÐеĿհ×ÐÐ
-v »ò --show-nonprinting
·¶Àý£º
cat -n textfile1 > textfile2 °Ñ textfile1 µÄµµ°¸ÄÚÈݼÓÉÏÐкźóÊäÈë textfile2 Õâ¸öµµ°¸Àï
cat -b textfile1 textfile2 >> textfile3 °Ñ textfile1 ºÍ textfile2 µÄµµ°¸ÄÚÈݼÓÉÏÐкţ¨¿Õ°×Ðв»¼Ó£©Ö®ºó½«ÄÚÈݸ½¼Óµ½ textfile3
Ãû³Æ : cd
ʹÓÃȨÏÞ : ËùÓÐʹÓÃÕß
ʹÓ÷½Ê½ : cd [dirName]
˵Ã÷ : ±ä»»¹¤×÷Ŀ¼ÖÁ dirName¡£ ÆäÖÐ dirName ±íʾ·¨¿ÉΪ¾ø¶Ô·¾¶»òÏà¶Ô·¾¶¡£ÈôĿ¼Ãû³ÆÊ¡ÂÔ£¬Ôò±ä»»ÖÁʹÓÃÕßµÄ home directory (Ò²¾ÍÊÇ¸Õ login ʱËùÔÚµÄĿ¼)¡£
ÁíÍ⣬"~" Ò²±íʾΪ home directory µÄÒâ˼£¬"." ÔòÊDZíʾĿǰËùÔÚµÄĿ¼£¬".." Ôò±íʾĿǰĿ¼λÖõÄÉÏÒ»²ãĿ¼¡£
·¶Àý : Ìøµ½ /usr/bin/ :
cd /usr/bin
Ìøµ½×Ô¼ºµÄ home directory :
cd ~
Ìøµ½Ä¿Ç°Ä¿Â¼µÄÉÏÉÏÁ½²ã :
cd ../..
Ö¸ÁîÃû³Æ : chmod
ʹÓÃȨÏÞ : ËùÓÐʹÓÃÕß
ʹÓ÷½Ê½ : chmod [-cfvR] [--help] [--version] mode file...
˵Ã÷ : Linux/Unix µÄµµ°¸´æȡȨÏÞ·ÖΪÈý¼¶ : µµ°¸ÓµÓÐÕß¡¢Èº×é¡¢ÆäËû¡£ÀûÓà chmod ¿ÉÒÔ½åÒÔ¿ØÖƵµ°¸ÈçºÎ±»ËûÈËËù´æÈ¡¡£
°Ñ¼Æ :
mode : ȨÏÞÉ趨×Ö´®£¬¸ñʽÈçÏ : [ugoa...][[+-=][rwxX]...][,...]£¬ÆäÖÐu ±íʾ¸Ãµµ°¸µÄÓµÓÐÕߣ¬g ±íʾÓë¸Ãµµ°¸µÄÓµÓÐÕßÊôÓÚͬһ¸öȺÌå(group)Õߣ¬o ±íʾÆäËûÒÔÍâµÄÈË£¬a ±íʾÕâÈýÕß½ÔÊÇ¡£
+ ±íʾÔö¼ÓȨÏÞ¡¢- ±íʾȡÏûȨÏÞ¡¢= ±íʾΨһÉ趨ȨÏÞ¡£
r ±íʾ¿É¶ÁÈ¡£¬w ±íʾ¿ÉдÈ룬x ±íʾ¿ÉÖ´ÐУ¬X ±íʾֻÓе±¸Ãµµ°¸ÊǸö×ÓĿ¼»òÕ߸õµ°¸ÒѾ±»É趨¹ýΪ¿ÉÖ´ÐС£
-c : Èô¸Ãµµ°¸È¨ÏÞȷʵÒѾ¸ü¸Ä£¬²ÅÏÔʾÆä¸ü¸Ä¶¯×÷
-f : Èô¸Ãµµ°¸È¨ÏÞÎÞ·¨±»¸ü¸ÄÒ²²»ÒªÏÔʾ´íÎóѶϢ
-v : ÏÔʾȨÏÞ±ä¸üµÄÏêϸ×ÊÁÏ
-R : ¶ÔĿǰĿ¼ÏµÄËùÓеµ°¸Óë×ÓĿ¼½øÐÐÏàͬµÄȨÏÞ±ä¸ü(¼´ÒԵݻصķ½Ê½Öð¸ö±ä¸ü)
--help : ÏÔʾ¸¨Öú˵Ã÷
--version : ÏÔʾ°æ±¾
·¶Àý :½«µµ°¸ file1.txt ÉèΪËùÓÐÈ˽ԿɶÁÈ¡ :
chmod ugo+r file1.txt
½«µµ°¸ file1.txt ÉèΪËùÓÐÈ˽ԿɶÁÈ¡ :
chmod a+r file1.txt
½«µµ°¸ file1.txt Óë file2.txt ÉèΪ¸Ãµµ°¸ÓµÓÐÕߣ¬ÓëÆäËùÊôͬһ¸öȺÌåÕß¿ÉдÈ룬µ«ÆäËûÒÔÍâµÄÈËÔò²»¿ÉдÈë :
chmod ug+w,o-w file1.txt file2.txt
½« ex1.py É趨ΪֻÓиõµ°¸ÓµÓÐÕß¿ÉÒÔÖ´ÐÐ :
chmod u+x ex1.py
½«Ä¿Ç°Ä¿Â¼ÏµÄËùÓеµ°¸Óë×ÓĿ¼½ÔÉèΪÈκÎÈ˿ɶÁÈ¡ :
chmod -R a+r *
´ËÍâchmodÒ²¿ÉÒÔÓÃÊý×ÖÀ´±íʾȨÏÞÈç chmod 777 file
Ó﷨Ϊ£ºchmod abc file
ÆäÖÐa,b,c¸÷Ϊһ¸öÊý×Ö£¬·Ö±ð±íʾUser¡¢Group¡¢¼°OtherµÄȨÏÞ¡£
r=4£¬w=2£¬x=1
ÈôÒªrwxÊôÐÔÔò4+2+1=7£»
ÈôÒªrw-ÊôÐÔÔò4+2=6£»
ÈôÒªr-xÊôÐÔÔò4+1=7¡£
·¶Àý£º
chmod a=rwx file
ºÍ
chmod 777 file
Ч¹ûÏàͬ
chmod ug=rwx,o=x file
ºÍ
chmod 771 file
Ч¹ûÏàͬ
ÈôÓÃchmod 4755 filename¿Éʹ´Ë³Ìʽ¾ßÓÐrootµÄȨÏÞ
Ö¸ÁîÃû³Æ : chown
ʹÓÃȨÏÞ : root
ʹÓ÷½Ê½ : chmod [-cfhvR] [--help] [--version] user[:group] file...
˵Ã÷ : Linux/Unix ÊǶàÈ˶๤×÷ҵϵͳ£¬ËùÓеĵµ°¸½ÔÓÐÓµÓÐÕß¡£ÀûÓà chown ¿ÉÒÔ½«µµ°¸µÄÓµÓÐÕß¼ÓÒԸı䡣һ°ãÀ´Ëµ£¬Õâ¸öÖ¸ÁîÖ»ÓÐÊÇÓÉϵͳ¹ÜÀíÕß(root)ËùʹÓã¬Ò»°ãʹÓÃÕßûÓÐȨÏÞ¿ÉÒԸıä±ðÈ˵ĵµ°¸ÓµÓÐÕߣ¬Ò²Ã»ÓÐȨÏÞ¿ÉÒÔ×Ô¼ºµÄµµ°¸ÓµÓÐÕ߸ÄÉèΪ±ðÈË¡£Ö»ÓÐϵͳ¹ÜÀíÕß(root)²ÅÓÐÕâÑùµÄȨÏÞ¡£
°Ñ¼Æ :
user : еĵµ°¸ÓµÓÐÕßµÄʹÓÃÕß IDgroup : еĵµ°¸ÓµÓÐÕßµÄʹÓÃÕßȺÌå(group)-c : Èô¸Ãµµ°¸ÓµÓÐÕßȷʵÒѾ¸ü¸Ä£¬²ÅÏÔʾÆä¸ü¸Ä¶¯×÷-f : Èô¸Ãµµ°¸ÓµÓÐÕßÎÞ·¨±»¸ü¸ÄÒ²²»ÒªÏÔʾ´íÎóѶϢ-h : Ö»¶ÔÓÚÁ¬½á(link)½øÐбä¸ü£¬¶ø·Ç¸Ã link ÕæÕýÖ¸ÏòµÄµµ°¸-v : ÏÔʾӵÓÐÕß±ä¸üµÄÏêϸ×ÊÁÏ-R : ¶ÔĿǰĿ¼ÏµÄËùÓеµ°¸Óë×ÓĿ¼½øÐÐÏàͬµÄÓµÓÐÕß±ä¸ü(¼´ÒԵݻصķ½Ê½Öð¸ö±ä¸ü)--help : ÏÔʾ¸¨Öú˵Ã÷--version : ÏÔʾ°æ±¾
·¶Àý :
½«µµ°¸ file1.txt µÄÓµÓÐÕßÉèΪ users ȺÌåµÄʹÓÃÕß jessie :
chown jessie:users file1.txt
½«Ä¿Ç°Ä¿Â¼ÏµÄËùÓеµ°¸Óë×ÓĿ¼µÄÓµÓÐÕß½ÔÉèΪ users ȺÌåµÄʹÓÃÕß lamport :
chmod -R lamport:users *
Ãû³Æ£ºcp
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£º
cp [options] source dest
cp [options] source... directory
˵Ã÷£º½«Ò»¸öµµ°¸¿½±´ÖÁÁíÒ»µµ°¸£¬»ò½«Êý¸öµµ°¸¿½±´ÖÁÁíһĿ¼¡£
°Ñ¼Æ?
-a ¾¡¿ÉÄܽ«µµ°¸×´Ì¬¡¢È¨ÏÞµÈ×ÊÁ϶¼ÕÕÔ×´ÓèÒÔ¸´ÖÆ¡£
-r Èô source Öк¬ÓÐĿ¼Ãû£¬Ôò½«Ä¿Â¼ÏÂÖ®µµ°¸Òà½ÔÒÀÐò¿½±´ÖÁÄ¿µÄµØ¡£
-f ÈôÄ¿µÄµØÒѾÓÐÏàͬµµÃûµÄµµ°¸´æÔÚ£¬ÔòÔÚ¸´ÖÆÇ°ÏÈÓèÒÔɾ³ýÔÙÐи´ÖÆ¡£
·¶Àý£º
½«µµ°¸ aaa ¸´ÖÆ(ÒÑ´æÔÚ)£¬²¢ÃüÃûΪ bbb :
cp aaa bbb
½«ËùÓеÄCÓïÑÔ³Ìʽ¿½±´ÖÁ Finished ×ÓĿ¼ÖÐ :
cp *.c Finished
Ãû³Æ£ºcut
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
Ó÷¨£ºcut -cnum1-num2 filename
˵Ã÷£ºÏÔʾÿÐдӿªÍ·ËãÆð num1 µ½ num2 µÄÎÄ×Ö¡£
·¶Àý£º
shell>> cat example
test2
this is test1
shell>> cut -c0-6 example ## print ¿ªÍ·ËãÆðÇ° 6 ¸ö×ÖÔª
test2
this i
Ãû³Æ : find
Ó÷¨ : find
ʹÓÃ˵Ã÷ :
½«µµ°¸ÏµÍ³ÄÚ·ûºÏ expression µÄµµ°¸ÁгöÀ´¡£Äã¿ÉÒÔÖ¸Òªµµ°¸µÄÃû³Æ¡¢Àà±ð¡¢Ê±¼ä¡¢´óС¡¢È¨Ï޵Ȳ»Í¬×ÊѶµÄ×éºÏ£¬Ö»ÓÐÍêÈ«Ïà·ûµÄ²Å»á±»ÁгöÀ´¡£
find ¸ù¾ÝÏÂÁйæÔòÅÐ¶Ï path ºÍ expression£¬ÔÚÃüÁîÁÐÉϵÚÒ»¸ö - ( ) , ! ֮ǰµÄ²¿·ÝΪ path£¬Ö®ºóµÄÊÇ expression¡£Èç¹û path ÊÇ¿Õ×Ö´®ÔòʹÓÃĿǰ·¾¶£¬Èç¹û expression ÊÇ¿Õ×Ö´®ÔòʹÓà -print ΪԤÉè expression?
expression ÖпÉʹÓõÄÑ¡ÏîÓжþÈýÊ®¸öÖ®¶à£¬ÔÚ´ËÖ»½éÉÜ×î³£ÓõIJ¿·Ý¡£
-mount, -xdev : Ö»¼ì²éºÍÖ¸¶¨Ä¿Â¼ÔÚͬһ¸öµµ°¸ÏµÍ³Ïµĵµ°¸£¬±ÜÃâÁгöÆäËüµµ°¸ÏµÍ³Öеĵµ°¸
-amin n : ÔÚ¹ýÈ¥ n ·ÖÖÓÄÚ±»¶ÁÈ¡¹ý
-anewer file : ±Èµµ°¸ file ¸üÍí±»¶ÁÈ¡¹ýµÄµµ°¸
-atime n : ÔÚ¹ýÈ¥ n Ìì¹ý¶ÁÈ¡¹ýµÄµµ°¸
-cmin n : ÔÚ¹ýÈ¥ n ·ÖÖÓÄÚ±»Ð޸Ĺý
-cnewer file :±Èµµ°¸ file ¸üеĵµ°¸
-ctime n : ÔÚ¹ýÈ¥ n Ìì¹ýÐ޸ĹýµÄµµ°¸
-empty : ¿ÕµÄµµ°¸-gid n or -group name : gid ÊÇ n »òÊÇ group Ãû³ÆÊÇ name
-ipath p, -path p : ·¾¶Ãû³Æ·ûºÏ p µÄµµ°¸£¬ipath »áºöÂÔ´óСд
-name name, -iname name : µµ°¸Ãû³Æ·ûºÏ name µÄµµ°¸¡£iname »áºöÂÔ´óСд
-size n : µµ°¸´óС ÊÇ n µ¥Î»£¬b ´ú±í 512 λԪ×éµÄÇø¿é£¬c ±íʾ×ÖÔªÊý£¬k ±íʾ kilo bytes£¬w ÊǶþ¸öλԪ×é¡£-type c : µµ°¸ÀàÐÍÊÇ c µÄµµ°¸¡£
d: Ŀ¼
c: ×ÖÐÍ×°Öõµ°¸
b: Çø¿é×°Öõµ°¸
p: ¾ßÃûÖüÁÐ
f: Ò»°ãµµ°¸
l: ·ûºÅÁ¬½á
s: socket
-pid n : process id ÊÇ n µÄµµ°¸
Äã¿ÉÒÔʹÓà ( ) ½«ÔËËãʽ·Ö¸ô£¬²¢Ê¹ÓÃÏÂÁÐÔËËã¡£
exp1 -and exp2
! expr
-not expr
exp1 -or exp2
exp1, exp2
·¶Àý:
½«Ä¿Ç°Ä¿Â¼¼°Æä×ÓĿ¼ÏÂËùÓÐÑÓÉìµµÃûÊÇ c µÄµµ°¸ÁгöÀ´¡£
# find . -name "*.c"
½«Ä¿Ç°Ä¿Â¼ÆäÆäÏÂ×ÓĿ¼ÖÐËùÓÐÒ»°ãµµ°¸Áгö
# find . -ftype f
½«Ä¿Ç°Ä¿Â¼¼°Æä×ÓĿ¼ÏÂËùÓÐ×î½ü 20 ·ÖÖÓÄÚ¸üйýµÄµµ°¸Áгö
# find . -ctime -20
Ãû³Æ£ºless
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£º
less [Option] filename
˵Ã÷£º
less µÄ×÷ÓÃÓë more Ê®·ÖÏàËÆ£¬¶¼¿ÉÒÔÓÃÀ´ä¯ÀÀÎÄ×Öµµ°¸µÄÄÚÈÝ£¬²»Í¬µÄÊÇ less ÔÊÐíʹÓÃÕßÍù»Ø¾í¶¯
ÒÔä¯ÀÀÒѾ¿´¹ýµÄ²¿·Ý£¬Í¬Ê±ÒòΪ less ²¢Î´ÔÚÒ»¿ªÊ¼¾Í¶ÁÈëÕû¸öµµ°¸£¬Òò´ËÔÚÓöÉÏ´óÐ͵µ°¸µÄ¿ªÆôʱ£¬»á±ÈÒ»°ãµÄÎÄÊé±à¼Æ÷(Èç vi)À´µÄ¿ìËÙ¡£
·¶Àý£º
Ö¸ÁîÃû³Æ : ln
ʹÓÃȨÏÞ : ËùÓÐʹÓÃÕß
ʹÓ÷½Ê½ : ln [options] source dist£¬ÆäÖÐ option µÄ¸ñʽΪ :
[-bdfinsvF] [-S backup-suffix] [-V {numbered,existing,simple}]
[--help] [--version] [--]
˵Ã÷ : Linux/Unix µµ°¸ÏµÍ³ÖУ¬ÓÐËùνµÄÁ¬½á(link)£¬ÎÒÃÇ¿ÉÒÔ½«ÆäÊÓΪµµ°¸µÄ±ðÃû£¬¶øÁ¬½áÓÖ¿É·ÖΪÁ½ÖÖ : Ó²Á¬½á(hard link)ÓëÈíÁ¬½á(symbolic link)£¬Ó²Á¬½áµÄÒâ˼ÊÇÒ»¸öµµ°¸¿ÉÒÔÓжà¸öÃû³Æ£¬¶øÈíÁ¬½áµÄ·½Ê½ÔòÊDzúÉúÒ»¸öÌØÊâµÄµµ°¸£¬¸Ãµµ°¸µÄÄÚÈÝÊÇÖ¸ÏòÁíÒ»¸öµµ°¸µÄλÖá£Ó²Á¬½áÊÇ´æÔÚͬһ¸öµµ°¸ÏµÍ³ÖУ¬¶øÈíÁ¬½áÈ´¿ÉÒÔ¿çÔ½²»Í¬µÄµµ°¸ÏµÍ³¡£
ln source dist ÊDzúÉúÒ»¸öÁ¬½á(dist)µ½ source£¬ÖÁÓÚʹÓÃÓ²Á¬½á»òÈíÁ´½áÔòÓɲÎÊý¾ö¶¨¡£
²»ÂÛÊÇÓ²Á¬½á»òÈíÁ´½á¶¼²»»á½«Ô±¾µÄµµ°¸¸´ÖÆÒ»·Ý£¬Ö»»áÕ¼Ó÷dz£ÉÙÁ¿µÄ´Åµú¿Õ¼ä¡£
-f : Á´½áʱÏȽ«Óë dist ͬµµÃûµÄµµ°¸É¾³ý-d : ÔÊÐíϵͳ¹ÜÀíÕßÓ²Á´½á×Ô¼ºµÄĿ¼-i : ÔÚɾ³ýÓë dist ͬµµÃûµÄµµ°¸Ê±ÏȽøÐÐѯÎÊ-n : ÔÚ½øÐÐÈíÁ¬½áʱ£¬½« dist ÊÓΪһ°ãµÄµµ°¸-s : ½øÐÐÈíÁ´½á(symbolic link)-v : ÔÚÁ¬½á֮ǰÏÔʾÆäµµÃû-b : ½«ÔÚÁ´½áʱ»á±»¸²Ð´»òɾ³ýµÄµµ°¸½øÐб¸·Ý-S SUFFIX : ½«±¸·ÝµÄµµ°¸¶¼¼ÓÉÏ SUFFIX µÄ×Öβ-V METHOD : Ö¸¶¨±¸·ÝµÄ·½Ê½--help : ÏÔʾ¸¨Öú˵Ã÷--version : ÏÔʾ°æ±¾
·¶Àý :
½«µµ°¸ yy ²úÉúÒ»¸ö symbolic link : zz
ln -s yy zz
½«µµ°¸ yy ²úÉúÒ»¸ö hard link : zz
ln yy xx
Ãû³Æ£ºlocate
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£º locate [-q] [-d ] [--database=]
locate [-r ] [--regexp=]
locate [-qv] [-o ] [--output=]
locate [-e ] [-f ] <[-l ] [-c]
<[-U ] [-u]>
locate [-Vh] [--version] [--help]
˵Ã÷£º
locate ÈÃʹÓÃÕß¿ÉÒԺܿìËÙµÄËÑÑ°µµ°¸ÏµÍ³ÄÚÊÇ·ñÓÐÖ¸¶¨µÄµµ°¸¡£Æä·½·¨ÊÇÏȽ¨Á¢Ò»¸ö°üÀ¨ÏµÍ³ÄÚËùÓеµ°¸Ãû³Æ¼°Â·¾¶µÄ×ÊÁϿ⣬֮ºóµ±Ñ°ÕÒʱ¾ÍÖ»Ðè²éѯÕâ¸ö×ÊÁϿ⣬¶ø²»±Øʵ¼ÊÉîÈëµµ°¸ÏµÍ³Ö®ÖÐÁË¡£
ÔÚÒ»°ãµÄ distribution Ö®ÖУ¬×ÊÁÏ¿âµÄ½¨Á¢¶¼±»·ÅÔÚ contab ÖÐ×Ô¶¯Ö´ÐС£Ò»°ãʹÓÃÕßÔÚʹÓÃʱֻҪÓÃ
# locate your_file_name
µÄÐÍʽ¾Í¿ÉÒÔÁË¡£ ²ÎÊý£º
-u
-U
½¨Á¢×ÊÁϿ⣬-u »áÓɸùĿ¼¿ªÊ¼£¬-U Ôò¿ÉÒÔÖ¸¶¨¿ªÊ¼µÄλÖá£
-e
½«
ÅųýÔÚÑ°Õҵķ¶Î§Ö®Íâ¡£
-l
Èç¹û ÊÇ 1£®ÔòÆô¶¯°²È«Ä£Ê½¡£ÔÚ°²È«Ä£Ê½Ï£¬Ê¹ÓÃÕß²»»á¿´µ½È¨ÏÞÎÞ·¨¿´µ½µÄµµ°¸¡£Õâ»áʼËٶȼõÂý£¬ÒòΪ locate ±ØÐëÖÁʵ¼ÊµÄµµ°¸ÏµÍ³ÖÐÈ¡µÃµµ°¸µÄȨÏÞ×ÊÁÏ¡£
-f
½«Ìض¨µÄµµ°¸ÏµÍ³ÅųýÔÚÍ⣬ÀýÈçÎÒÃÇûÓе½ÀíÒª°Ñ proc µµ°¸ÏµÍ³Öеĵµ°¸·ÅÔÚ×ÊÁÏ¿âÖС£
-q
°²¾²Ä£Ê½£¬²»»áÏÔʾÈκδíÎóѶϢ¡£
-n
ÖÁ¶àÏÔʾ ¸öÊä³ö¡£
-r
ʹÓÃÕý¹æÔËËãʽ ×öÑ°ÕÒµÄÌõ¼þ¡£
-o
Ö¸¶¨×ÊÁÏ¿â´æµÄÃû³Æ¡£
-d
Ö¸¶¨×ÊÁÏ¿âµÄ·¾¶
-h
ÏÔʾ¸¨ÖúѶϢ
-v
ÏÔʾ¸ü¶àµÄѶϢ
-V
ÏÔʾ³ÌʽµÄ°æ±¾Ñ¶Ï¢ ·¶Àý£º
locate chdrv : Ñ°ÕÒËùÓнРchdrv µÄµµ°¸
locate -n 100 a.out : Ñ°ÕÒËùÓнРa.out µÄµµ°¸£¬µ«×î¶àÖ»ÏÔʾ 100 ¸ö
locate -u : ½¨Á¢×ÊÁÏ¿â
Ãû³Æ : ls
ʹÓÃȨÏÞ : ËùÓÐʹÓÃÕß
ʹÓ÷½Ê½ : ls [-alrtAFR] [name...]
˵Ã÷ : ÏÔʾָ¶¨¹¤×÷Ŀ¼ÏÂÖ®ÄÚÈÝ£¨ÁгöÄ¿Ç°¹¤×÷Ŀ¼Ëùº¬Ö®µµ°¸¼°×ÓĿ¼)¡£
-a ÏÔʾËùÓеµ°¸¼°Ä¿Â¼ (lsÄÚ¶¨½«µµ°¸Ãû»òĿ¼Ãû³Æ¿ªÍ·Îª"."µÄÊÓΪÒþ²Øµµ£¬²»»áÁгö)
-l ³ýµµ°¸Ãû³ÆÍ⣬Òཫµµ°¸ÐÍ̬¡¢È¨ÏÞ¡¢ÓµÓÐÕß¡¢µµ°¸´óСµÈ×ÊѶÏêϸÁгö
-r ½«µµ°¸ÒÔÏà·´´ÎÐòÏÔʾ(Ô¶¨ÒÀÓ¢ÎÄ×Öĸ´ÎÐò)
-t ½«µµ°¸ÒÀ½¨Á¢Ê±¼äÖ®ÏȺó´ÎÐòÁгö
-A ͬ -a £¬µ«²»Áгö "." (ĿǰĿ¼) ¼° ".." (¸¸Ä¿Â¼)
-F ÔÚÁгöµÄµµ°¸Ãû³Æºó¼ÓÒ»·ûºÅ£»ÀýÈç¿ÉÖ´ÐеµÔò¼Ó "*", Ŀ¼Ôò¼Ó "/"
-R ÈôĿ¼ÏÂÓеµ°¸£¬ÔòÒÔÏÂÖ®µµ°¸Òà½ÔÒÀÐòÁгö
·¶Àý£º
ÁгöÄ¿Ç°¹¤×÷Ŀ¼ÏÂËùÓÐÃû³ÆÊÇ s ¿ªÍ·µÄµµ°¸£¬ÓúеÄÅÅÓúºóÃæ :
ls -ltr s*
½« /bin Ŀ¼ÒÔÏÂËùÓÐĿ¼¼°µµ°¸Ïêϸ×ÊÁÏÁгö :
ls -lR /bin
ÁгöÄ¿Ç°¹¤×÷Ŀ¼ÏÂËùÓеµ°¸¼°Ä¿Â¼£»Ä¿Â¼ÓÚÃû³Æºó¼Ó "/", ¿ÉÖ´ÐеµÓÚÃû³Æºó¼Ó "*" :
ls -AF
Ãû³Æ£ºmore
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£ºmore [-dlfpcsu] [-num] [+/pattern] [+linenum] [fileNames..]
˵Ã÷£ºÀàËÆ cat £¬²»¹ý»áÒÔÒ»Ò³Ò»Ò³µÄÏÔʾ·½±ãʹÓÃÕßÖðÒ³ÔĶÁ£¬¶ø×î»ù±¾µÄÖ¸Áî¾ÍÊÇ°´¿Õ°×¼ü£¨space£©¾ÍÍùÏÂÒ»Ò³ÏÔʾ£¬°´ b ¼ü¾Í»áÍù»Ø£¨back£©Ò»Ò³ÏÔʾ£¬¶øÇÒ»¹ÓÐËÑÑ°×Ö´®µÄ¹¦ÄÜ£¨Óë vi ÏàËÆ£©£¬Ê¹ÓÃÖеÄ˵Ã÷Îļþ£¬Çë°´ h ¡£
²ÎÊý£º-num Ò»´ÎÏÔʾµÄÐÐÊý
-d ÌáʾʹÓÃÕߣ¬ÔÚ»ÃæÏ·½ÏÔʾ [Press space to continue, q to quit.] £¬Èç¹ûʹÓÃÕß°´´í¼ü£¬Ôò»áÏÔʾ [Press h for instructions.] ¶ø²»ÊÇ ßÙ Éù
-l È¡ÏûÓö¼ûÌØÊâ×ÖÔª ^L£¨ËÍÖ½×ÖÔª£©Ê±»áÔÝÍ£µÄ¹¦ÄÜ
-f ¼ÆËãÐÐÊýʱ£¬ÒÔʵ¼ÊÉϵÄÐÐÊý£¬¶ø·Ç×Ô¶¯»»ÐйýºóµÄÐÐÊý£¨ÓÐЩµ¥ÐÐ×ÖÊýÌ«³¤µÄ»á±»À©Õ¹ÎªÁ½ÐлòÁ½ÐÐÒÔÉÏ£©
-p ²»ÒÔ¾í¶¯µÄ·½Ê½ÏÔʾÿһҳ£¬¶øÊÇÏÈÇå³ýÓ©Ä»ºóÔÙÏÔʾÄÚÈÝ
-c ¸ú -p ÏàËÆ£¬²»Í¬µÄÊÇÏÈÏÔʾÄÚÈÝÔÙÇå³ýÆäËû¾É×ÊÁÏ
-s µ±Óöµ½ÓÐÁ¬ÐøÁ½ÐÐÒÔÉϵĿհ×ÐУ¬¾Í´ú»»ÎªÒ»ÐеĿհ×ÐÐ
-u ²»ÏÔʾÏÂÒýºÅ £¨¸ù¾Ý»·¾³±äÊý TERM Ö¸¶¨µÄ terminal ¶øÓÐËù²»Í¬£©
+/ ÔÚÿ¸öµµ°¸ÏÔʾǰËÑÑ°¸Ã×Ö´®£¨pattern£©£¬È»ºó´Ó¸Ã×Ö´®Ö®ºó¿ªÊ¼ÏÔʾ
+num ´ÓµÚ num ÐпªÊ¼ÏÔʾ
fileNames ÓûÏÔʾÄÚÈݵĵµ°¸£¬¿ÉΪ¸´Êý¸öÊý
·¶Àý£º
more -s testfile ÖðÒ³ÏÔʾ testfile Ö®µµ°¸ÄÚÈÝ£¬ÈçÓÐÁ¬ÐøÁ½ÐÐÒÔÉÏ¿Õ°×ÐÐÔòÒÔÒ»Ðпհ×ÐÐÏÔʾ¡£
more +20 testfile ´ÓµÚ 20 ÐпªÊ¼ÏÔʾ testfile Ö®µµ°¸ÄÚÈÝ¡£
Ãû³Æ£ºmv
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£º
mv [options] source dest
mv [options] source... directory
˵Ã÷£º½«Ò»¸öµµ°¸ÒÆÖÁÁíÒ»µµ°¸£¬»ò½«Êý¸öµµ°¸ÒÆÖÁÁíһĿ¼¡£
²ÎÊý£º-i ÈôÄ¿µÄµØÒÑÓÐͬÃûµµ°¸£¬ÔòÏÈѯÎÊÊÇ·ñ¸²¸Ç¾Éµµ¡£
·¶Àý£º
½«µµ°¸ aaa ¸üÃûΪ bbb :
mv aaa bbb
½«ËùÓеÄCÓïÑÔ³ÌʽÒÆÖÁ Finished ×ÓĿ¼ÖÐ :
mv -i *.c
Ãû³Æ£ºrm
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£ºrm [options] name...
˵Ã÷£ºÉ¾³ýµµ°¸¼°Ä¿Â¼¡£
°Ñ¼Æ?
-i ɾ³ýÇ°ÖðһѯÎÊÈ·ÈÏ¡£
-f ¼´Ê¹Ôµµ°¸ÊôÐÔÉèΪΨ¶Á£¬ÒàÖ±½Óɾ³ý£¬ÎÞÐèÖðһȷÈÏ¡£
-r ½«Ä¿Â¼¼°ÒÔÏÂÖ®µµ°¸ÒàÖðһɾ³ý¡£
·¶Àý£º
ɾ³ýËùÓÐCÓïÑÔ³Ìʽµµ£»É¾³ýÇ°ÖðһѯÎÊÈ·ÈÏ :
rm -i *.c
½« Finished ×ÓĿ¼¼°×ÓĿ¼ÖÐËùÓеµ°¸É¾³ý :
rm -r Finished
Ãû³Æ£ºrmdir
ʹÓÃȨÏÞ£ºÓÚĿǰĿ¼ÓÐÊʵ±È¨ÏÞµÄËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£º rmdir [-p] dirName
˵Ã÷£º ɾ³ý¿ÕµÄĿ¼¡£
²ÎÊý£º -p Êǵ±×ÓĿ¼±»É¾³ýºóʹËüÒ²³ÉΪ¿ÕĿ¼µÄ»°£¬Ôò˳±ãÒ»²¢É¾³ý¡£
·¶Àý£º
½«¹¤×÷Ŀ¼Ï£¬ÃûΪ AAA µÄ×ÓĿ¼ɾ³ý :
rmdir AAA
ÔÚ¹¤×÷Ŀ¼Ï嵀 BBB Ŀ¼ÖУ¬É¾³ýÃûΪ Test µÄ×ÓĿ¼¡£Èô Test ɾ³ýºó£¬BBB Ŀ¼³ÉΪ¿ÕĿ¼£¬Ôò BBB ÒàÓèɾ³ý¡£
rmdir -p BBB/Test
Ãû³Æ£ºsplit
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£ºsplit [OPTION] [INPUT [PREFIX]]
˵Ã÷£º
½«Ò»¸öµµ°¸·Ö¸î³ÉÊý¸ö¡£¶ø´Ó INPUT ·Ö¸îÊä³ö³É¹Ì¶¨´óСµÄµµ°¸£¬ÆäµµÃûÒÀÐòΪ PREFIXaa, PREFIXab...£»PREFIX Ô¤ÉèֵΪ `x¡£ÈôûÓÐ INPUT µµ»òΪ `-£¬Ôò´Ó±ê×¼ÊäÈë¶Á½ø×ÊÁÏ¡£
¿ï¶µ?
-b, --bytes=SIZE
SIZE ֵΪÿһÊä³öµµ°¸µÄ´óС£¬µ¥Î»Îª byte¡£
-C, --line-bytes=SIZE
ÿһÊä³öµµÖУ¬µ¥ÐеÄ×î´ó byte Êý¡£
-l, --lines=NUMBER
NUMBER ֵΪÿһÊä³öµµµÄÁÐÊý´óС¡£
-NUMBER
Óë -l NUMBER Ïàͬ¡£
--verbose
ÓÚÿ¸öÊä³öµµ±»¿ªÆôÇ°£¬ÁÐÓ¡³öÕì´í×ÊѶµ½±ê×¼´íÎóÊä³ö¡£
--help
ÏÔʾ¸¨Öú×ÊѶȻºóÀ뿪¡£
--version
Áгö°æ±¾×ÊѶȻºóÀ뿪¡£
SIZE ¿É¼ÓÈ뵥λ: b ´ú±í 512£¬ k ´ú±í 1K£¬ m ´ú±í 1 Meg¡£
·¶Àý£º
PostgresSQL ´óÐÍ×ÊÁϿⱸ·ÝÓë»Ø´æ£º
Òò Postgres ÔÊÐí±í¸ñ´ó¹ýÄãϵͳµµ°¸µÄ×î´óÈÝÁ¿£¬ËùÒÔÒª½«±í¸ñ dump µ½µ¥Ò»µÄµµ°¸¿ÉÄÜ»áÓÐÎÊÌ⣬ʹÓà split½øÐеµ°¸·Ö¸î¡£
% pg_dump dbname | split -b 1m - filename.dump.
ÖØÐÂÔØÈë
% createdb dbname
% cat filename.dump.* | pgsql dbname
Ãû³Æ£ºtouch
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£º
touch [-acfm]
[-r reference-file] [--file=reference-file]
[-t MMDDhhmm[[CC]YY][.ss]]
[-d time] [--date=time] [--time={atime,access,use,mtime,modify}]
[--no-create] [--help] [--version]
file1 [file2 ...]
˵Ã÷£º
touch Ö¸Áî¸Ä±äµµ°¸µÄʱ¼ä¼Ç¼¡£ ls -l ¿ÉÒÔÏÔʾµµ°¸µÄʱ¼ä¼Ç¼¡£
²ÎÊý£º
a ¸Ä±äµµ°¸µÄ¶Áȡʱ¼ä¼Ç¼¡£
m ¸Ä±äµµ°¸µÄÐÞ¸Äʱ¼ä¼Ç¼¡£
c ¼ÙÈçÄ¿µÄµµ°¸²»´æÔÚ£¬²»»á½¨Á¢Ðµĵµ°¸¡£Óë --no-create µÄЧ¹ûÒ»Ñù¡£
f ²»Ê¹Óã¬ÊÇΪÁËÓëÆäËû unix ϵͳµÄÏàÈÝÐÔ¶ø±£Áô¡£
r ʹÓòο¼µµµÄʱ¼ä¼Ç¼£¬Óë --file µÄЧ¹ûÒ»Ñù¡£
d É趨ʱ¼äÓëÈÕÆÚ£¬¿ÉÒÔʹÓø÷ÖÖ²»Í¬µÄ¸ñʽ¡£
t É趨µµ°¸µÄʱ¼ä¼Ç¼£¬¸ñʽÓë date Ö¸ÁîÏàͬ¡£
--no-create ²»»á½¨Á¢Ðµµ°¸¡£
--help ÁгöÖ¸Áî¸ñʽ¡£
--version Áгö°æ±¾Ñ¶Ï¢¡£
·¶Àý£º
×î¼òµ¥µÄʹÓ÷½Ê½£¬½«µµ°¸µÄʱºò¼Ç¼¸ÄΪÏÖÔÚµÄʱ¼ä¡£Èôµµ°¸²»´æÔÚ£¬ÏµÍ³»á½¨Á¢Ò»¸öеĵµ°¸¡£
touch file
touch file1 file2
½« file µÄʱ¼ä¼Ç¼¸ÄΪ 5 Ô 6 ÈÕ 18 µã 3 ·Ö£¬¹«ÔªÁ½Ç§Äꡣʱ¼äµÄ¸ñʽ¿ÉÒԲο¼ date Ö¸ÁÖÁÉÙÐèÊäÈë MMDDHHmm £¬¾ÍÊÇÔÂÈÕʱÓë·Ö¡£
touch -c -t 05061803 file
touch -c -t 050618032000 file
½« file µÄʱ¼ä¼Ç¼¸Ä±ä³ÉÓë referencefile Ò»Ñù¡£
touch -r referencefile file
½« file µÄʱ¼ä¼Ç¼¸Ä³É 5 Ô 6 ÈÕ 18 µã 3 ·Ö£¬¹«ÔªÁ½Ç§Äꡣʱ¼ä¿ÉÒÔʹÓà am, pm »òÊÇ 24 СʱµÄ¸ñʽ£¬ÈÕÆÚ¿ÉÒÔʹÓÃÆäËû¸ñʽÈç 6 May 2000 ¡£
touch -d "6:03pm" file
touch -d "05/06/2000" file
touch -d "6:03pm 05/06/2000" file
fjlycfq ÓÚ 2008-03-11 11:35:06·¢±í:
²»´í£¬ºÃÎÄ¡£¡£¡£¡£
robertmaggie ÓÚ 2007-11-14 09:37:59·¢±í:
ºÜʹÓà ²»´í