Let's say that I want the output of ls viewed in nano or tilde.

I would do the following:

ls >> tmp
nano tmp
rm tmp

I don't like this because it creates a dumpfile that I sometimes forget to delete. Some people suggest this:

ls | less


ls | more

But I cannot do:

ls | nano

So how to solve this? I would need this especially when it comes to huge terminal outputs like the current processes where I would like to do a search afterwards.

  • 1
    @steeldriver because I like the text editor tilde and the way all the hotkeys are layed out. I can work quickly with that. I have not gotten used to less and don't feel the the need to ... Commented Nov 30, 2019 at 14:42
  • thank you for your question! Commented Nov 20, 2020 at 15:49

5 Answers 5


Many programs conventionally use - to mean standard input or standard output. Thus, you can open the screen output of a command in nano using - as the file name, as in:

ls | nano -

This will only work if your program does support that convention. This includes nano and vi on the terminal. Even the graphical text editor gedit supports it. However, pluma or mousepad do not support it, and instead will be instructed to create a regular file named -. In other cases, you cannot get around creating a regular intermediate file first.

  • This works for me with nano. But when I try it with tilde I get "No such option -" Commented Nov 30, 2019 at 17:31
  • 3
    This only works if the consuming command explicitly supports it; it's common but far from universal. Commented Dec 1, 2019 at 0:33

If viewing with tilde is really needed, you may script your idea
Create a function in your .bashrc

function tildeIt () {
  "$@" > $tmpfile
  tilde $tmpfile
  rm $tmpfile

# $@ is all words typed after tildeIt
# mktemp creates a temp file and returns his fullname

Reload .bashrc

source ~/.bashrc


tildeIt command -option
  • 1
    This is pretty cool. Thanks! +1 Commented Nov 30, 2019 at 17:27
  • 1
    Please, teach people to use mktemp instead of creating temp filenames with just $$. Commented Dec 1, 2019 at 6:03
  • @Guntram Blohm supports Monica : ok, more elegant, i edit
    – cmak.fr
    Commented Dec 1, 2019 at 6:06

If you have vipe, you can do

ls | vipe >/dev/null

The program vipe (which I believe stands for either vi pipe or view pipe) reads standard in, opens $EDITOR on it, and writes whatever is left when you save-and-quit to standard out.


On *nix, everything is a file. Thus, you can read the standard input from a file. In theory that is. Some programs get a bit iffy.

Depending on the editor, you can read /dev/stdin. For example, cat works, but gedit complains that /dev/stdin is a special file and can't be edited.

ls | cat /dev/stdin #works
ls | nano /dev/stdin #doesn't work.
ls | vim /dev/stdin #doesn't work
ls | gvim /dev/stdin #works

What works with this method and what doesn't seem to be easily distinguished. So just try it with what you want, and it will either work, or not.

  • geany works too with both geany <(ls -1) and ls | geany /dev/stdin.
    – Hermann
    Commented Dec 1, 2019 at 17:54

If you're using bash, you might try tilde <( ls ).

See Process Substitution in bash(1).

You must log in to answer this question.

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