158 Discovering and Using Linux Commands In this (Web site)
158 Discovering and Using Linux Commands In this listing, the first column has the heading PID and shows a number for each process. PID stands for process ID (identification), which is a sequential number assigned by the Linux kernel. If you look through the output of the ps ax command, you see that the init command is the first process and that it has a PID or process number of 1. That s why init is referred to as the mother of all processes. The COMMAND column shows the command that created each process, and the TIME column shows the cumulative CPU time used by the process. The STAT column shows the state of a process S means the process is sleeping and R means it s running. The symbols following the status letter have further meanings, such as < indicates a high-priority process and + means that the process is running in the foreground. The TTY column shows the terminal, if any, associated with the process. The process ID or process number is useful when you have to forcibly stop an errant process. Look at the output of the ps ax command and note the PID of the offending process. Then, use the kill command with that process number. To stop process number 8550, for example, type the following command: kill -9 8550 The -9 option means send signal number 9 to the process. It just so happens that signal number 9 is the KILL signal, which causes the process to exit. Working with date and time You can use the date command to display the current date and time or set a new date and time. Type date at the shell prompt and you get a result similar to the following: Sat Sep 4 21:38:08 EDT 2004 As you can see, the date command alone displays the current date and time. To set the date, log in as root and then type date followed by the date and time in the MMDDhhmmYYYY format, where each character is a digit. For example, to set the date and time to December 31, 2005 and 9:30 p.m., you type date 123121302005 The MMDDhhmmYYYY date and time format is similar to the 24-hour military clock, and has the following meaning: . MM is a two-digit number for the month (01 through 12). . DD is a two-digit number for the day of the month (01 through 31).
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.