Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to find all the files that contain a search term:

grep -lir "Search" .

and pipe that into sublime:

grep -lir "Search" . | subl

but all this does is open a single file in sublime containing all the search results file paths as lines in the file. What I would like is to open each of those files as a sublime project.

share|improve this question
up vote 5 down vote accepted

Using the command subl $(grep -lir "Search" .) will give you the expected output. The $(command) expands with the output of the command and gives it as input to the sublime command. More information can be found in the Bash Manual.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .