TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Work smarter on *nix with jobs

1 pointsby danielwozniakover 12 years ago
Many people use screen and tmux. These tools are useful but are not always available and tend to be a bit overkill. There is a lighter way of switching between tasks in *nix environments. Say your working in vim and want to fire up ipython to test some code. Pressing &#60;ctrl&#62;-z backgrounds your vim job. You'll drop to your shell and can fire up ipython. When your ready to leave ipython you can again press &#60;ctrl&#62;-z. Now you have two jobs in the background. The `jobs` command will show you what is in the background and their numbers. To bring the most recent job back to the foreground use the `fg` command in this case ipython come back to the foreground. If you want to bring vim back use `fg 1` to bring, that's `fg` and the number of the job you want. You can also launch commands and send them to the background by appending the &#38; character to your command. To run tail in the background allowing you to work in your shell but still see log output as it's written to the file try:<p>tail -f /var/log/syslog &#38;<p>Here is a link to jobs man page.<p>http://www.lehman.cuny.edu/cgi-bin/man-cgi?jobs+1<p>Since learning jobs after much poking and prodding from people smarter than myself I have realized I don't need screen. The only draw back is jobs will go away if you exit your shell. If you need to leave and come back but don't want a heavy terminal multiplexer check out dtach.

no comments

no comments