"&" after a command in commandline
hello,
I read that by typing "&" after a command in the commandline,this process runs in the background so it doesnot make the bash busy running it and you still have your commandline to type more commands,but when I typed "vim a.cpp & " and then enter,I was given [1] and 3909 ,what do these numbers mean,and how is "a.cpp" running on my system? Thanks |
Hello,
LOL What you basically did was to tell the shell to run the vim editor on the file "a.cpp" and to run the session in the background. Since running something in background detaches the screen and keyboard from the running process, you basically had an editing session running with no I/O on the file. (BTW: This is a useful thing to do if you want to momentarily postpone your editing of a source file to check something else out and want a full blown shell to do it in.) The [1] indicated that it was the first process running in background for your shell, and the 3909 was the process ID assigned to the process. To get the edit session "reattached" to the screen and keyboard you can type "fg". This instructs the shell to bring the currently running background process back into the foreground. |
hi again,
can you instruct me on the meaning of running a process in the background and foreground. Thanks |
|
All times are GMT -5. The time now is 06:31 AM. |