How to Run a Shell Command from Python and Get The Output?

In Python, often you may want to execute linux command and get the output of the command as string variable. There are multiple ways to execute shell command and get output using Python. A naive way to do that is to execeute the linux command, save the output in file and parse the file. Get… Continue reading How to Run a Shell Command from Python and Get The Output?

How To Set PATH variable on Bash Shell?

How Set PATH Variable on BASH Shell?

Have a new executable file/program? Want to execute it just by typing the name of the program instead of full path where the program is located?  The best solution is to add the path to new executable to your list of all search paths. The idea is that every time one types a command the… Continue reading How To Set PATH variable on Bash Shell?

Understanding Variables in Shell Scripting

A number of beautiful and powerful programming languages, like Python, Ruby, and Perl are available for scripting needs. Even then you may find the old school unix shell scripting very useful tool to learn and use. For sure, shell scripts looks crazy and hard to read/understand. Once you get a hang of it, you might… Continue reading Understanding Variables in Shell Scripting

How to Get a Specific Line or Lines From a Big File? Hint: Use One Liner AWK

If you are working with a huge text file with millions of lines and want to know the content of a specific line, there are a few tricks you can play to get the line you want.  The naive approach of reading the file line by line (say in python) and keeping a count on… Continue reading How to Get a Specific Line or Lines From a Big File? Hint: Use One Liner AWK

Tips to Get Started with Screen, the Terminal Multiplexer

The more you feel comfortable with terminal, the higher the number of terminals that will be open. For sure you will many things to keep a tab, one for your email, one for the code, one for executing the code, and so on. And one might easily get annoyed, rightly so, recreating your multiple sessions… Continue reading Tips to Get Started with Screen, the Terminal Multiplexer