Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

When I run the following command in linux:

find / -iname httpd.conf

I get:


I want to use nano to edit this file, lazy to type the file path again, I used:

find / -iname httpd.conf | nano

It didn't work, nano quickly opened and exited, then I found a file in the directory that I ran this command. Using cat command on, it outputs the text: /usr/local/apache/conf/httpd.conf

This means nano thinks the previous piped output as a string that I want to write to a file, but the fact is, I would like nano to think it as the file path so that it actually opens the file for me to do the editing.

How can we make nano accept previous piped output as a file path?

share|improve this question
up vote 3 down vote accepted

Nano behaves like expected, since a pipe is used to connect on program's output to another one's input.

What you want instead is to use the output of find as an argument for nano:

nano `find / -iname httpd.conf`
share|improve this answer
But why does nano consider the input as the file content rather than the file path? – bobo Feb 7 '10 at 1:18
Because pipes connect output to inputs You want to substitute a nano parameter with a program output – Benjamin Bannier Feb 7 '10 at 5:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.