I started a process from the command line, but the window server died. However I see the process I started is still running. Is it possible to connect a terminal to the process to see its output?  This is the process:  ps -A | grep foo 73186 ??       4011:34.91 ./foo
42910
I know how to redirect output and how to  in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2&gt;&amp;1 or &gt; /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.  To be more specific as asked by  in his comment, I would like to fiddle with it in these scenarios in specific:   wrong output file forgot to redirect stderr to stdout   or a combination of both  E.g. I have Apache running and I can see the file descriptors:  /proc/8019/fd/0 -&gt; /dev/null /proc/8019/fd/1 -&gt; /dev/null /proc/8019/fd/2 -&gt; /var/log/apache2/error.log
45475
So I echo output of my programs ran in terminal by command 2&gt;&amp;1 &gt;&gt; /path/toFile.txt  It creates few limitations that I want to overcome:   It "freezes" and gives no output in terminal - only way to see actual output is to open output file Opening output file is not giving live results. It gives results from time of opening that file     How to echo output to a file and be able to:  a) see live changes in that file (separate program would be needed I assume)  or  b) output to file and see that output in terminal in the same time
118767
I'm very new to Ubuntu. If I do this sort of command say:  cp file1 file2   The shell creates a child process and that child process will call cp, which in turn call exec system call of operating system.   Are there any command to visualize this process from my terminal?
86279
Here is the behaviour I want to understand:  $ ps   PID TTY           TIME CMD   392 ttys000    0:00.20 -bash  4268 ttys000    0:00.00 xargs $ kill 4268 $ ps   PID TTY           TIME CMD   392 ttys000    0:00.20 -bash [1]+  Terminated: 15          xargs $ ps   PID TTY           TIME CMD   392 ttys000    0:00.21 -bash   Why does it show the [1]+  Terminated: 15          xargs after I kill a process, instead of just not showing it as it was just killed?  I'm using bash on Mac OS X 10.7.5.
25822
If you have gnome-terminal running, and want a new instance of the program, you might think that running gnome-terminal &amp; from a shell would do the trick.  Astonishingly, this new instance behaves like some insipid Windows or Mac program; it only sends a message to the existing, running gnome-terminal to create a new window. If this one gnome-terminal process crashes, you lose all of the terminal windows!  (Of course, each window has its own shell, which is an independent process, but the actual terminal emulator and its GUI are managed from a single instance of the application.)  How can we create independent instances of gnome-terminal, each running in their own process, so that killing that process only destroys the window(s) associated with that process?
106602
I run command ps -A | grep &lt;application_name&gt; and getting list of process like this:  19440 ?        00:00:11 &lt;application_name&gt; 21630 ?        00:00:00 &lt;application_name&gt; 22694 ?        00:00:00 &lt;application_name&gt;   I want to kill all process from the list: 19440, 21630, 22694.  I have tried ps -A | grep &lt;application_name&gt; | xargs kill -9 $1 but it works with errors.  kill: illegal pid ? kill: illegal pid 00:00:00 kill: illegal pid &lt;application_name&gt;   How can I do this gracefully?
47480
I'm trying to measure the execution time of a process that I call via the command line (i.e., I want to find out how long it takes to for the process to finish). Is there any command that I can add to the command calling the process that will achieve this?
177
What is a terminal? How do I open a terminal window? How do I use the terminal?
40776
Does anyone know tools like  to hook processes? The features I would like to have are:   log function calls on other processes GUI scriptable opensource   I already looked at some tools like:        but none really fully satisfies me.
59914
I want to start a process from a shell script, allow it to interact with the user (so I cannot just background it, grab the PID, launch sleep followed by sanity checks and kill), but if it is still running after a set period of time (say, two minutes), then and only then do I want to kill it.  The intention is to simply implement a wallclock-run-time timeout for a program that doesn't have that capability built in.  Is there a way to do this, preferably from a bash shell script?
44814
So I'm trying to run foo.exe, but I don't want the output to the terminal but into a file. Running foo.exe &gt; foo.txt should accomplish this for me, but it's not. When I'm running the exe-file, I get the output. The exe is working fine in other words. However, when I try to send the output to a file, the only thing I get is this:  'c:/Program' is not recognized as an internal or external command, operable program or batch file.   This only shows up when I try to send it to a file. Thinking that it could be the path (which is c:\Program Files (x86)\ and so on) which is misinterpreted, I tried specifying the output file like so: foo.exe &gt; c:\test.txt, but still no joy.  So, aside from stating that the binary that I am trying to run is poorly written, is there anything I can do to remedy this? Keep in mind that I do get valid output when simply running the exe, it just won't print nicely to a file. Obviously the output is there, the question is if there is some way to catch it.
38093
Possible Duplicate:          I have a process which is basically a web-server, I start it during an SSH session. However, when I leave the session (by closing the PuTTY windows), it stops running and responding to requests. This is true even if I end the command with a &amp;. With Apache, I don't have this problem, it comes with a stop, a start, and a restart script. I'd like to create something like that for this program.  How can I start a process, so that it will continue running even after I end the SSH session I started it in? Also how can I set it to restart itself if it stops for some reason?  Thanks!
70290
I often lose track of the command flow due to the long text output of some commands, so I would like to have a main terminal window where user commands are executed and other terminal windows that „pop up“ displaying the commands' output and then are closed with the use of a short-cut.  Is it possible to code such a behavior? Any tips about the language I should use?  An even more user-friendly interaction would be for the terminal to ask whether it should display the output externally if it exceeds a user-set limit.
5548
Sometimes I want to start a process and forget about it. If I start it from the command line, like this:  redshift   I can't close the terminal, or it will kill the process. Can I run a command in such a way that I can close the terminal without killing the process?
31209
I got a program vsftpd which output doesn't seem to be either stdout or stderr (if that's even possible?)  My terminal output is:  ~# vsftpd 500 OOPS: SSL: cannot load RSA private key   I tried to redirect to a file but I get nothing in the file and the output still goes to the console:  ~#vsftpd &gt; /tmp/out.txt 500 OOPS: SSL: cannot load RSA private key  ~#vsftpd &amp;&gt; /tmp/out.txt 500 OOPS: SSL: cannot load RSA private key  ~#vsftpd 2&gt; /tmp/out.txt 500 OOPS: SSL: cannot load RSA private key   I'm actually trying to call this program from .Net Core from which I'm not able to get the StdOut/StdErr neither. And .Net Core crashes with The process cannot access the file because it is being used by another process. unless I enable StdIn-redirect, which I don't understand, I'm not parsing anything to StdIn and I never experienced this before with any other program calls.
84932
After opening a pipe to a process with popen, is there a way to kill the process that has been started? (Using pclose is not what I want because that will wait for the process to finish, but I need to kill it.)
5524
Is there any application (or sequence of commands) for this function: seeing the result of the actions, while using a GUI interface, being automatically translated into a Terminal (or similar CLI environment) on the same machine.  I saw this in action long years ago in VBA for Applications (for example the Macros in Excel). I wonder if there is same function in Linux.