Saturday, August 7, 2010

Bash Tips - using **

This is a nice bash shell feature which I find handy quite often when editing multiple files.
Say you have the following directory structure

degreethem-lm:bash jithine$ ls *
folder1:
test.txt

folder2:
test.txt
Now if I want to edit both the text files under I can use the ** operator like this.

degreethem-lm:bash jithine$ vim -p **/test.txt

The above command will open both the test.txt for editing in vim.

No comments: