LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Basic question (https://www.linuxquestions.org/questions/linux-newbie-8/basic-question-221835/)

a2715mt 08-24-2004 01:19 PM

Basic question
 
Hi
I am new to Unix and Linux.
I just have a very basic question:

When I run 'PS' command, I only got two lines like below:
=====================
PID TT S TIME COMMAND
1327 pts/0 S 0:00 -csh
=====================

But if I run 'PS -a' command, I got more lines like below:
=============================
PID TT S TIME COMMAND
327 console S 0:00 /usr/lib/saf/ttymon -g -h -p milford3 console login: -
1327 pts/0 S 0:00 -csh
1347 pts/0 O 0:00 ps -a
=============================

My question is "Isn't 'PS' command mean the current running process?"
If so, how come when given argument, it will show more current running process?

Thanks a lot!

WhiteChedda 08-24-2004 01:27 PM

Re: Basic question
 
Quote:

Originally posted by a2715mt
Hi
I am new to Unix and Linux.
I just have a very basic question:

When I run 'PS' command, I only got two lines like below:
=====================
PID TT S TIME COMMAND
1327 pts/0 S 0:00 -csh
=====================

But if I run 'PS -a' command, I got more lines like below:
=============================
PID TT S TIME COMMAND
327 console S 0:00 /usr/lib/saf/ttymon -g -h -p milford3 console login: -
1327 pts/0 S 0:00 -csh
1347 pts/0 O 0:00 ps -a
=============================

My question is "Isn't 'PS' command mean the current running process?"
If so, how come when given argument, it will show more current running process?

Thanks a lot!

-a show processes of other users too

When you specify the 'a' command line option you are showing processes started by users/accounts other than just your account.

add u to heave it tell you which user started the process, and x to show processes without controlling terminals, togather this is show all processes.

To learn a little more about ps try here

http://man.he.net/?topic=ps&section=all

a2715mt 08-24-2004 01:34 PM

PS command
 
So 'PS' and 'PS -ax' all mean the current running process?

pete the crab 08-24-2004 01:37 PM

PS gives a snapshot of the running processes, by adding the switches you refine the actions of the command. In the case of -a you select all with a TTY except session leaders. I think this means that you show the processes that are talking to your screen(?)

If you try ps -A you will get a list of all the processes, remember that Linux and UNIX are case sensitive.

This is in Red Hat, I guess the rest of the distros are much the same?

a2715mt 08-24-2004 01:48 PM

Thank you for your reply.

What does this mean?

-a List information about all processes most fre-
quently requested: all those except process group
leaders and processes not associated with a termi-
nal.


"most frequently requested"?

pete the crab 08-25-2004 06:39 AM

most frequently requested
 
I guess that that means as it says. Your screen will refresh very quickly and that will be a process.

Like you I am a real new comer to Linux so I am trying to and learn at the same time......

chrism01 08-25-2004 07:08 AM

ps is a distro/Unix ver dependent cmd. for instance, on my RH9 system we get (from the man page):

Code:


      -a          select all with a tty except session leaders
      a            select all processes on a terminal,  includ-
                    ing those of other users

which is explained by this:

Code:

COMMAND-LINE OPTIONS
      This version of ps accepts several kinds of options.
              Unix98 options may be grouped and must be preceeded by a dash.
              BSD options may be grouped and must not be used with a dash.
              GNU long options are preceeded by two dashes.
      Options of different types may be freely mixed.

:)

remotemate2003 08-25-2004 07:27 AM

I think doing

#man as

and

#info as

* where # is your console prompt

should give you indepth information on what this command does and all the options you could use with it, in fact you can do #man [command] for any linux command.

Cheers

a2715mt 08-25-2004 08:29 AM

PS -au showed me as root
 
How come when I typed 'PS -au' it showed me as root? I didn't log in as root.


root 15234 0.2 0.5 1448 1176 pts/1 O 09:27:24 0:00 ps -ua

a2715mt 08-25-2004 08:39 AM

Continues Question
 
What does this mean?

"... x to show processes without controlling terminals..."


What are controlling terminals?


All times are GMT -5. The time now is 06:49 AM.