LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-24-2004, 02:19 PM   #1
a2715mt
LQ Newbie
 
Registered: Jun 2004
Posts: 8

Rep: Reputation: 0
Cool 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!
 
Old 08-24-2004, 02:27 PM   #2
WhiteChedda
Member
 
Registered: Aug 2003
Location: Florida
Distribution: Mandrake 9.1 for now
Posts: 205

Rep: Reputation: 30
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

Last edited by WhiteChedda; 08-24-2004 at 02:28 PM.
 
Old 08-24-2004, 02:34 PM   #3
a2715mt
LQ Newbie
 
Registered: Jun 2004
Posts: 8

Original Poster
Rep: Reputation: 0
Cool PS command

So 'PS' and 'PS -ax' all mean the current running process?
 
Old 08-24-2004, 02:37 PM   #4
pete the crab
LQ Newbie
 
Registered: Jun 2004
Posts: 10

Rep: Reputation: 0
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?
 
Old 08-24-2004, 02:48 PM   #5
a2715mt
LQ Newbie
 
Registered: Jun 2004
Posts: 8

Original Poster
Rep: Reputation: 0
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"?
 
Old 08-25-2004, 07:39 AM   #6
pete the crab
LQ Newbie
 
Registered: Jun 2004
Posts: 10

Rep: Reputation: 0
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......
 
Old 08-25-2004, 08:08 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,254

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
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.
 
Old 08-25-2004, 08:27 AM   #8
remotemate2003
LQ Newbie
 
Registered: Aug 2004
Location: India
Distribution: all linux
Posts: 21

Rep: Reputation: Disabled
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
 
Old 08-25-2004, 09:29 AM   #9
a2715mt
LQ Newbie
 
Registered: Jun 2004
Posts: 8

Original Poster
Rep: Reputation: 0
Question 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
 
Old 08-25-2004, 09:39 AM   #10
a2715mt
LQ Newbie
 
Registered: Jun 2004
Posts: 8

Original Poster
Rep: Reputation: 0
Cool Continues Question

What does this mean?

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


What are controlling terminals?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic C++ question ooagentbender Programming 10 12-10-2003 10:34 PM
*very* basic c question usernamed Programming 9 08-21-2003 09:29 AM
Very basic question rajanr Linux - Newbie 2 07-23-2003 04:13 AM
A really basic question pilotgi Linux - Newbie 10 10-14-2002 05:57 PM
basic question kurgan70 Linux - General 2 12-06-2001 04:42 PM


All times are GMT -5. The time now is 09:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration