Coffee and a Command line – jobs

Last time I focused on using screen for multiple terminal sessions. Today, I will use a built in Linux ability to accomplish similar results. In Linux, you have the ability to start utilities and send them to the background. Once they are in the background, you can of course, bring them to the foreground again.
Using a keyboard shortcut and a couple of commands; you can do this easily.
Start an ssh session:
ssh -p 22 user@remotehost
Start a task on the remote host and send it to the background:
$top
At this point, using ctl+z, you can send ‘top’ into the background:
$ top [1]+ Stopped top $
Start Irssi:
$irssi
Send it to the background with ctl+z
$irssi [2]+ Stoppped irssi $
Then check the background jobs running with ‘jobs’:
$jobs [1]- Stopped top [2]+ Stopped irssi $
Now to come back to the local terminal without killing the ssh session, use shift+~ followed separately by ctl+z (the ~ will not show up in the terminal until after you issue the ctl+z)
$ ~^Z [susend ssh] [3]+ $
You have now returned to the local shell without actually exiting the ssh session.
now check jobs again:
$jobs [1] Stopped top [2]- Stopped irssi [3]+ Stopped ssh -p 22 user@remotehost $
In order to bring the jobs back to the foreground, we use fg n (n being the number of the background job)
fg 1
This brings top to the foreground and you access each of the other processes in the same way using the corosponding number from the list produced by the ‘jobs’ command.
it is that simple to use a single terminal to perform multiple tasks! Enjoy the CLI and
Happy Slackin! ![]()
usr
Popularity: 18% [?]
Subscribes
Be Social
Archives
ISC Security feed
- Infocon: greenOpera 10.62 - security (the DLL path issue) and stability upate see http://www.opera.com/docs/changelogs/windows/1062/ […]
- Opera 10.62 - security (the DLL path issue) and stability upate see http://www.opera.com/docs/changelogs/windows/1062/, (Thu, Sep 9th)...(more)... […]
- Adobe Acrobat/Reader 0-day in Wild, Adobe Issues Advisory, (Wed, Sep 8th)We just received word that there is a report of a 0-day exploit for Adobe Acrobat/Reader being explo ...(more)... […]
- Mozilla Thunderbird updated to version 3.1.3 also, more here: http://www.mozillamessaging.com/en-US/thunderbird/3.1.3/releasenotes/, (Wed, Sep 8th)...(more)... […]
- Patches issued for multiple vulnerabilities in Cisco Wireless LAN Contoller product family, more here: http://cisco.com/warp/public/707/cisco-sa-20100908-wlc.shtml, (Wed, Sep 8th)...(more)... […]
- Mozilla's SeaMonkey version 2.0.7 released for Security Updates: http://www.seamonkey-project.org/releases/seamonkey2.0.7/, (Wed, Sep 8th)...(more)... […]
- Firefox Releases Version 3.6.9 and 3.5.12 to fix Security Vulnerabilities: 3.6.9 is http://www.mozilla.com/en-US/firefox/3.6.9/releasenotes/ and 3.5.12 is http://www.mozilla.com/en-US/firefox/3.5.12/releasenotes/, (Wed, Sep 8th)...(more)... […]
- SSH password authentication insight and analysis by DRG, (Tue, Sep 7th)We've been writing about SSH brute force attempts for numerous times already. A lot of security rese ...(more)... […]
- US Department of Defense and National Policy, (Sun, Sep 5th)A recent article released by the US Department of Defense (DoD) spoke of the worst compromise in DoD ...(more)... […]
- What's not to Like about "Like?", (Sat, Sep 4th)Get off of my lawn! I admidt that I have a suspicous, curmedgeonly strea ...(more)... […]
- Infocon: green
Tags
- "operating systems" apps Blog chat client command line commands Computers design desktop Development fluxbox Geeks gentoo government Hardware how to Internet IRC Linux management network networking News package personal politics program prostitution review security server servers social network SSH systems taxes terminal text Tips Top 10 Tutorials twitter web wondow managers



1 Comment
Pingback & Trackback
Random Post
Leave Your Comments Below