LinuxQuestions.org
Visit Jeremy's Blog.
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 02-29-2008, 02:32 AM   #1
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Rep: Reputation: 30
What is the command? Process and Error


Dear,

Question:

1. When I execute a command in CLI, what is the command use to check that the previous command is run successful without error? It is $?

2. How I to check the current running program? What is the command?

Please assist.
 
Old 02-29-2008, 03:04 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

1) After a command is finished you can indeed use $? to check the exit status.

2) What do you want to check? If the process is still active there is no exit status (yet).

Hope this helps.
 
Old 02-29-2008, 06:35 AM   #3
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by druuna View Post
Hi,

1) After a command is finished you can indeed use $? to check the exit status.

2) What do you want to check? If the process is still active there is no exit status (yet).

Hope this helps.

Thanks for reply.

For question two, i am not to check the exit status. i just want to view the any current program/daemon are running on the system.
How ya? PID? or any other command?
 
Old 02-29-2008, 07:14 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

I'm still not sure what it is you want.

- ps -ef will show all programs (including daemons) that are started,
- $PPID holds the pid of the paraent ('starting') program,
- $PID holds the pid of the current program.

Hope this helps.
 
  


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
Process Checking Command ratul_11 Linux - General 2 12-26-2007 06:52 AM
ps command - current process e_annoos_h Linux - Software 2 06-03-2007 03:55 PM
at command: process not working mirat46 Linux - Newbie 4 05-05-2006 12:17 AM
Process command name?! swati220781 Linux - Newbie 3 07-02-2004 03:15 AM
Kill a process by command ITJedi Programming 3 03-07-2003 10:49 AM


All times are GMT -5. The time now is 06:07 PM.

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