[ת]Linux: ½áÊø²é¿´½ø³ÌÃüÁî
ÔÚubuntuÖУ¬ÖÕÖ¹Ò»¸ö½ø³Ì»òÖÕÖ¹Ò»¸öÕýÔÚÔËÐеijÌÐò£¬Ò»°ãÊÇͨ¹ý kill ¡¢killall¡¢pkill¡¢xkill µÈ½øÐС£
-------------------------------------------------------------------
ÏÈ¿´Á½¸öÀý×Ó£º
Àý×ÓÒ»£º½áÊøij¸ö³ÌÐò£¬ÈçFirefox
¼üÈëÃüÁ
pkill firefox
Àý×Ó¶þ: ½áÊøij¸ö½ø³Ì£¬Èçfind
ÏÈÓÃpsÃüÁîÀ´²é¿´¸Ã½ø³Ì¶ÔÓ¦µÄPID¡£
¼üÈëps£¬ÏÔʾÈçÏ£º
PID TTY TIME COMMAND
285 1 00:00:00 -bash
287 3 00:00:00 -bash
289 5 00:00:00 /sbin/mingetty tty5
290 6 00:00:00 /sbin/mingetty tty6
312 3 00:00:00 telnet bbs3
341 4 00:00:00 /sbin/mingetty tty4
345 1 00:00:00 find / -name foxy.jpg
348 1 00:00:00 ps
¿ÉÒÔ¿´µ½¸Ã½ø³Ì¶ÔÓ¦µÄPIDÊÇ345£¬ÏÖÔÚʹÓÃkillÃüÁîÀ´ÖÕÖ¹¸Ã½ø³Ì¡£
¼üÈ룺
# kill 345
ÔÙÓÃpsÃüÁî²é¿´£¬¾Í¿ÉÒÔ¿´µ½£¬find½ø³ÌÒѾ±»É±µôÁË¡£
---------------------------------------------------------------------------
ÏÂÃæÀ´Á˽âÏà¹ØÃüÁ
Ò»¡¢²é¿´½ø³ÌµÄÃüÁî ÓÐps¡¢pstree¡¢pgrepµÈ£º
1¡¢ps
ÏÔʾ½ø³ÌÐÅÏ¢£¬²ÎÊý¿ÉÊ¡ÂÔ
-aux ÒÔBSD·ç¸ñÏÔʾ½ø³Ì ³£ÓÃ
-efH ÒÔSystem V·ç¸ñÏÔʾ½ø³Ì
-e , -A ÏÔʾËùÓнø³Ì
a ÏÔʾÖÕ¶ËÉÏËùÓÐÓû§µÄ½ø³Ì
x ÏÔʾÎÞÖն˽ø³Ì
u ÏÔʾÏêϸÐÅÏ¢
f Ê÷×´ÏÔʾ
w ÍêÕûÏÔʾÐÅÏ¢
l ÏÔʾ³¤Áбí
ÔÚÖÕ¶ËÖÐÖ´ÐÐps aux,ÈçÏÂͼ£º
¸÷ÁÐÊä³ö×ֶεĺ¬Ò壺
USER
Ïà¹ØÎĵµ£º
ÄÚºËÖÕÓÚ±à¹ý²¢ÇÒÉý¼¶ÁË£¬±¾À´´òËã×¥½ô¼ÌÐøÍùÏÂѧϰ¡£µ«ÊÇÔÚÀÏÆŵĹÄÀøÏ£¬¸Ð¾õ»¹ÊÇÍ£ÏÂÀ´×ܽáϱȽϺã¬ÕâÑù¶Ô×Ô¼º¶Ô±ðÈ˶¼ÓÐËù°ïÖú¡£
0¡¢»·¾³½éÉÜ
ÎÒÊÇÔÚVirtualBox-3.1.6-59338-WinµÄÐéÄâ»úÉÏ°²×°ÁËubuntu-9.10-desktop-i386.iso¡£µçÄÔ±¾ÉíÊÇXPϵͳ¡£
×¢Ò⣬ÔÚ½øÐÐÏ ......
¡¡Í¨¹ý SCSI ÃüÁî¹ÜÀí¼ÆËã»úÉϵÄÊý¾Ý£¬²¢½«Êý¾Ý´«Êäµ½ SCSI É豸¡£ÔÚ±¾ÎÄÖУ¬×÷Õß½éÉÜÁËһЩ SCSI ÃüÁÒÔ¼°ÔÚ Linux? ÖÐʹÓà SCSI API ʱִÐÐ SCSI ÃüÁîµÄ·½·¨¡£Ëû½éÉÜÁË SCSI ¿Í»§»ú/·þÎñÆ÷Ä£Ðͺʹ洢 SCSI ÃüÁîµÄ±³¾°¡£½ÓÏÂÀ´½âÊÍ Linux ͨÓà SCSI Çý¶¯Æ÷ API£¬²¢Ìṩһ¸öʾÀý£¬ÌÖÂÛʹÓÃͨÓÃÇý¶¯Æ÷Ö´ÐÐ inquiry ÃüÁîµÄÏ ......
Ç°ÃæÁ½½ÚÒѾ½éÉÜÁËÓйØÐźŵĴ󲿷ÖÖª
ʶ¡£ÕâÒ»½ÚÎÒÃÇÀ´Á˽âÒ»ÏÂÕâЩϵͳµ÷Óá£ÆäÖУ¬ÏµÍ³µ÷ÓÃsignalÊǽø³ÌÓÃÀ´É趨ij¸öÐźŵĴ¦Àí·½·¨£¬ÏµÍ³µ÷ÓÃkillÊÇÓÃÀ´·¢ËÍÐźŸøÖ¸¶¨½ø³ÌµÄ¡£Õâ
Á½¸öµ÷ÓÿÉÒÔÐγÉÐźŵĻù±¾²Ù×÷¡£ºóÁ½¸öµ÷ÓÃpauseºÍalarmÊÇͨ¹ýÐźÅʵÏֵĽø³ÌÔÝÍ£ºÍ¶¨Ê±Æ÷£¬µ÷ÓÃalarmÊÇͨ¹ýÐźÅ֪ͨ½ø³Ì¶¨Ê±Æ÷µ ......
statº¯Êý½²½â£¨×ª£©
±íÍ·Îļþ: #include <sys/stat.h>
#include <unistd.h>
¶¨Ò庯Êý: int stat(const char *file_name, struct stat *buf);
º¯Êý˵Ã÷: ͨ¹ýÎļþÃûfilename»ñÈ¡ÎļþÐÅÏ¢ ......
Õ⼸ÌìÎÒ°²×°ÁËÒ»¸öLinuxϵͳ£¬ÏëÔÚÀïÃæѧһÏÂCÓïÑԵıàд£¬·¢ÏÖÔÚÀïÃæÔËÐÐÓÐÒ»¸öºÃÆæ¹ÖµÄÏÖÏó£ºÈçÏÂÃæ
#include<stdio.h>
void mian(){
printf("hello world!");
}
Êä³öûÓнá¹û£¡¸ãµÄÎÒ¿´ÁË°ëÌ죬³ÌÐòûÓдíÎó°¡£¡ÔõôÕâÑù£¡ºóÀ´ÎҰѳÌÐò¸ÄΪ
#include<stdio.h>
void mian(){
printf("hello ......