Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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?
-a List information about all processes most fre-
quently requested: all those except process group
leaders and processes not associated with a termi-
nal.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.