You run a "job" (or schedule it for later running) While its running, its a "process".
The ps command can show you the process ID number that the server assigned to your job which is useful for things like shutting it down early if you want to.
The lsof command is mostly useful to see what processes, files, directories, libraries, etc are being accessed by a job.
The lsof command is mostly useful to see what processes, files, directories, libraries, etc are being accessed by a job.
There is not much difference between jobs and processes. A job may consist of one ore more processes. Not all processes are jobs.
ps lists running processes with various statistics per process
lsof lists open files and the processes that opened them
ps lists running processes with various statistics per process
lsof lists open files and the processes that opened them
ps
Typing ps alone would list the current running processes. Below is an example of the output that would be generated by the ps command.
PID TTY TIME CMD
6874 pts/9 0:00 ksh
6877 pts/9 0:01 csh
418 pts/9 0:00 csh
6874 pts/9 0:00 ksh
6877 pts/9 0:01 csh
418 pts/9 0:00 csh
Display full information about each of the processes currently running.
UID PID PPID C STIME TTY TIME CMD
hope 29197 18961 0 Sep27 ? 00:00:06 sshd: hope@pts/87
hope 32097 29197 0 Sep27 pts/87 00:00:00 -csh
hope 7209 32097 0 12:17 pts/87 00:00:00 ps -ef
hope 29197 18961 0 Sep27 ? 00:00:06 sshd: hope@pts/87
hope 32097 29197 0 Sep27 pts/87 00:00:00 -csh
hope 7209 32097 0 12:17 pts/87 00:00:00 ps -ef
% ps -gx To find out all the process ID numbers of processes you are running, type: Here is an example of output from this command: PID TT STAT TIME COMMAND
12030 p5 S 0:01 -csh (csh)
12068 p5 T 1:46 emacs foo
12788 p5 R 0:00 ps -gxps -l
Displays processes including those that are in a wait state, similar to the below example.
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 0 T 0 12308 29722 0 80 0 - 16136 finish pts/0 00:00:00 pico 0 R 0 12530 29722 0 80 0 - 15884 - pts/0 00:00:00 ps 4 S 0 29722 29581 0 80 0 - 16525 wait pts/0 00:00:00 bash
To find the job numbers of all the background jobs you are running, type:
% jobs
No comments:
Post a Comment