Chinaunix首页 | 论坛 | 博客
  • 博客访问: 248078
  • 博文数量: 91
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 955
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-12 09:38
文章分类

全部博文(91)

文章存档

2017年(1)

2011年(1)

2008年(15)

2007年(74)

我的朋友

分类: LINUX

2007-08-23 16:31:51

ps
  the command generates a one-time snapshot of the current processes on standard output
 -a show processes that are owned by other users and attached to a terminal.normally,only the current user's processes are shown
 -f "forest" mode,which is used to display process family trees.for example.using this option will display all running chile web servers(httpd) in a hierarchical diagram under the parent web server.
 -l long format.which includes priority,parent PID,and other information.
 -u user format.which includes usenames and the start time of process
 -w wide output format.used to eliminate the default output line truncation useful for the -f option
 -x include processes without controlling terminals.ofen needed to see daemon processes and other not started from a terminal session.
 -c cmd display instance of command name cmd
 -U usr display process owned by username usr
 example:ps -aux or ps aux; ps u -C httpd ps -aux|grep httpd
 
pstree
  pstree [options] [pid|user]
 -a display command-line argumentds used to launch processes
 -c disable the compaction(压实的) of indentical subtrees
 -G use the VT100 line-drawing characters instead of plain characters to display the tree.this yields a much more pleasing display but may not be appropriate for printing or paging programs
 -h highlight the ancestry of the current process(usually the shell),the terminal must support highlighting for this option to be meaningful
 -n the default sort order for processes with the same parent is alphanumerically(文字数字的) by name.this option changes this behavior to a numeric sort by PID
 -p include PID in the output
 
top
 -b run in batch mode.this is useful for sending output from top to other programs or to a file.
 -d delay specify the delay in seconds between screen update,the default is five seconds
 -i ignore idle(空闲的),listing only the "interesting" ones taking system resources
 -n num display num iterations and then exit.instead of running indefinitely
 -q run with no display. the command is not recommended.
 -s run is secure mode .some of top'
s interactive commands can be dangerous if running as the superuser.this option disables them.
 frequence used interactive
 Ctrl-L repaint the screen
 h generate a help screen
 k kill a process,you will be prompted for the PID of the process and signal to send it(the default signal is 15,sigterm)
 n change the number of processes to show.you will be prompted to enter an integer number.the default signal is 0,which indicate that the screen should be filled
 q quit the program
 r renice a process(change its priority). you will be prompted for the PID for the process and the value to nice it to entering a positive value causes a process to lose priority.if the superuser is running top.a negative value may be entered,causing a process to get a higher than normal priority.this command is not vailable in secure mode
  for example top bin 5 d 1>file1 you may want to use top to log its output to a file.use the -b(batch) option for this purpose.in the batch example bin is three parameters.without the dash(破折号)
  hup 1 hang up,this signal is sent automaticall when you log out or disconnect a modem.it also used by many daemons to cause the configuration file to be reread.
  int 2 interrupt;stop running.this signal is sent when you type Ctrl-C
  kill 9 kill;stop unconditionally and immediately.
  Term 15 terminate,nicely if possible.this signal is used to ask a process to exit gracefully
  tstp 18 stop executing.ready to continue.this signal is sent when you type Ctrl-z.

kill
 kill [-s sigspec|-sigspec][pids]
 kill -1(digital) [signum]
 you may use -s sigspec or simply -sigspec to make up the signal value or name.if a sigspec is not given.then sigterm(signal 15,"exit gracefully") is assumed.the sigpec is followed by one or more pids to which the signal is to be sent.for example,the following cammands is equivalent:
 kill 1000 1001(1000,1001 all process id)
 kill -15 1000 1001
 kill -sigterm 1000 1001
 kill -SIGTERM 1000 1001
 kill -term 1000 1001
 kill -s 15 1000 1001
 kill -s sigterm 1000 1001
 to force a process to die,use the strongest kill:
 kill -9 1000 1001 or kill -kill 1000 1001
 the inetd superdaemon will respond to the HUP signal by rereading its configuration file.if you've made3 change to that file and want inetd to reconfigure itself,send it the HUP signal
  kill -HUP `cat /var/run/inetd.pid`

阅读(1178) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~