What is a & on a CLI
If I say type /usr/bin/crond & (And no I don't believe
this is where I saw but this example should work.) What will that &
do? I belive && in like make && make modules_install is
and.
-------------------------------------------------------------------
"/usr/bin/crond &" will run the program crond as
a background process, so that the console at which you typed the command
will still accept new commands.
Without that "&", the user will not be able to enter
any new commands until the program ends.
-------------------------------------------------------------------
What if I do "irssi &" so that I can type new commands.
How can I switch back to that irssi after I am done with my commands?
-------------------------------------------------------------------
Well, I could be wrong, but I think that once a task
is assigned as a background task you can't reassign it to the user. In
a case like this you would run the program normally (without the &),
and then press CTRL-ALT-F2 to switch to the second console. Then login
again there and do whatever else you wanted to do. You can then switch
between the tasks using CTRL-ALT-F1/F2.
If you want to run multiple consoles, you should really
get a graphical interface, as it will make things a WHOLE lot easier on
you.
-------------------------------------------------------------------
You certainly could be wrong Birdman ;-) - This is a
question where a RTFM response is appropriate, specifically:
info bash 'job control'
-------------------------------------------------------------------
To bring it back into the foreground type "fg". It is
the same when using Ctrl&Z to pause a program and then putting it into
the backround with "bg".
-------------------------------------------------------------------
&& runs the second command if the first succeeds,
so it's like "and" in PERL. || runs the second if the first fails.
Have a Linux Problem
Linux Forum
- Do you have a Linux Question?
Linux Books
Linux Certification,
System Administration, Programming, Networking Books
Linux Home: Linux
System Administration Hints and Tips
(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
All product names are trademarks of their respective
companies.
The site www.gotothings.com is in no way affiliated with
or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.
|