Daily Dose of Data Science

Share this post

Most Command-line Users Don't Know This Cool Trick About Using Terminals

www.blog.dailydoseofds.com

Discover more from Daily Dose of Data Science

High-quality insights on Data Science and Python, along with best practices — shared daily. Get a free 550+ page data science PDF guide and 450+ practice questions notebook.
Over 50,000 subscribers
Continue reading
Sign in

Most Command-line Users Don't Know This Cool Trick About Using Terminals

Avi Chawla
Feb 26, 2023
10
Share this post

Most Command-line Users Don't Know This Cool Trick About Using Terminals

www.blog.dailydoseofds.com
2
Share

Watch a video version of this post for better understanding: Video Link.

After running a command (or script, etc.), most command-line users open a new terminal to run other commands. But that is never required.

Here's how.

When we run a program from the command line, by default, it runs in the foreground. This means you can't use the terminal until the program has been completed.

However, if you add '&' at the end of the command, the program will run in the background and instantly free the terminal.

This way, you can use the same terminal to run another command.

To bring the program back to the foreground, use the 'fg' command.

Thanks for reading Daily Dose of Data Science! Subscribe for free to learn something new about Python and Data Science every day.


Check out Sourcery, an automated code refactoring tool for Python.

Find the code for my tips here: GitHub.

I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn.

10
Share this post

Most Command-line Users Don't Know This Cool Trick About Using Terminals

www.blog.dailydoseofds.com
2
Share
Previous
Next
2 Comments
Share this discussion

Most Command-line Users Don't Know This Cool Trick About Using Terminals

www.blog.dailydoseofds.com
Captain Black
Feb 26Liked by Avi Chawla

I love your stuff, thank you!

Expand full comment
Reply
Share
1 reply by Avi Chawla
1 more comment...
Top
New
Community

No posts

Ready for more?

© 2023 Avi Chawla
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing