ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I just need to get the command ps to run silently in the background. I can get it to run in the background but if I do it screws up results and displays something like a process id when I do) I need it to run in the background or even maybe hide it's output to see if it finds anything or not. I don't need to see if it's finds anything cause I just want a command to not run or well my script to not run if the process or another process of the same nature is running. example I don't want the script to run if my server shutdown or restart proocess is running (I will be using this in my restart, stop, and start codes) this will prevent rerunning them by accident
I have tried:
ps aux | grep -v grep | egrep 'stopphantasycraft' &
(ps aux | grep -v grep | egrep 'stopphantasycraft') &
both give some sort of result and then don't reset the command line and i press enter and it continues to give another result it's worse then just running it in the foreground and i don't know how to get it to work. Anyone got some alternatives? Thanks
Last edited by fatalerror0x00; 11-07-2012 at 10:51 AM.
I will try and figure out bg when I get home from work but thought that was the same thing as & just more of an at the time thing and bg for processes already running? The thing is for ps just & with my code DOESN'T give the desired results it DOESN'T run in the background it actually kinda runs in the forground and with more lines of some sorta output and exit code 3 times (1 time after each time you press enter) Thats not running in the background to me :P So I need a way to run ps in the background successfully thats it plain and simple :P if you can get it to run in the background in any way with no output then I really am glad to hear that and hope you can enlighten me cause even ps & doesn't run in the background. I know this program is about output but still I need it silenced.
seems this thread is popular :P i type that and got 2 more results Hang on guys trying this out.
Last edited by fatalerror0x00; 11-07-2012 at 11:09 AM.
Reason: more post