Bash tip: Search through history using the up and down arrows

Ctrl-R is one of the most useful commands on the terminal and it allows to browse through command history and re-use it again. On bash shell there is a much simpler way to search through your command history on terminal. Basically you can start typing the initial letter and then use up and down arrow… Continue reading Bash tip: Search through history using the up and down arrows

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?

How To Check If a File or Directory Exists Using Shell Script?

One of the common tasks in shell scripting in Linux/Mac OS, checking if a file or directory exists already and to create the file/directory if it does not exists. Here is how to check if a file or directory exists in Linux shell script. The basic syntax to check if a file exists is and… Continue reading How To Check If a File or Directory Exists Using Shell Script?

How To Change Dropbox’s Default Directory Location?

Who does not like Dropbox? Even Google wants a share of Dropbox users and finally launched Google Drive.  Dropbox gives freedom to our files from the desktop and gives life to be everywhere, on your mobile, on your tablet,  on your desktop, and in the cloud.  In MacOS X/Linux by default Dropbox creates the “Dropbox”… Continue reading How To Change Dropbox’s Default Directory Location?