Link to home
Start Free TrialLog in
Avatar of pigeon5566
pigeon5566

asked on

Regarding ps command

When i did a ps -eaf | grep -i Tscr i got the below output
ncc 25957 25953  0 18:00:00 ?         0:00 /usr/bin/ksh /top/cmds/Tscript

what does this "?"   in the output of the coomand means. Does this mean process is still running?

Avatar of bira
bira

the "?" represents a unknown TTY.

TTY is a short form of several things: # Short form of Teletype, in turn short form of Teletypewriter.# In general computing: any kind of terminal.# In the operating system Unix: any kind of terminal, or serial port, represented in the device hierarchy as /dev/tty*.# Is the most often used abbreviation for Telecommunications Device for the Deaf.
a little more:

TTY represents The controlling workstation for the process

if it appears "?" The process is not associated with a workstation
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

If a process shows in your ps list - then it was 'running' at that time. Although the purists' might argue about when a process is actually running.

A ? under the tty column heading signifies that the process, as commented earlier, has no controlling device. What this typically means is that there is no way to directly interact with the process via a man-machine-interface (terminal/keyboard) - sorry about the non-PC term MMI. ;-)

An 'uncontrolled' process will naturally conclude or it will need 'signalling' to change its behaviour.

On some versions of unix there is a -t? option to the ps command to list processes with no ttys' assigned.

If you have the online manual installed you might want to do a 'man ps' and check the -t option.

You might also want to do a 'man signal' to understand how these processes could be communicated with.

Chuck in a 'man nohup' for good measure.

Cheers
JJ
Avatar of pigeon5566

ASKER

Thanks a lot for the info.  I am not clear with the below things

1. who
sdc        ttyp0        Jul 16 01:57
sdc        ttyp1        Jul 16 03:29

what is the ttyp0? . Is it a random terminal name assigned to each time i login?

2. Also when i do a echo $TERM i am getting vt100 what is the TERM and is it purpose?

Now you are asking a different question.  It is better to open a new question for this.

However....

ttyp0 refers to the terminal device you are logged onto.  There are two types of tty devices:

1.  Physical, eg: console, serial
2.  Pseudo, eg: connecting via telent, ssh etc.

Psuedo device names vary.  Sometimes you'll see pts/0 or other variants.  The device numbers are simply allocated on a incrementing scale.

the $TERM environment variable refers to what terminal settings you are using.  All Unix/Linux systems come with a database of terminal definitions (terminfo) that has contains the escape/control sequences for things like bold text and what the function keys and arrow sequences are.  By setting the TERM environment variable, you are simply saying that the terminal you are using uses the definitions of a vt100 (which is a very common terminal emulation)
Thanks a lot for the info