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

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

Avi Chawla
Feb 26, 2023
9
2
Share
Share this post

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

www.blog.dailydoseofds.com

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.

9
2
Share
Share this post

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

www.blog.dailydoseofds.com
Previous
Next
2 Comments
Captain Black
Feb 26Liked by Avi Chawla

I love your stuff, thank you!

Expand full comment
Reply
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