Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Why does ls | nano - open the editor in Ubuntu but close the editor and save a file to in CentOS?

How can I get nano in CentOS to remain open when reading stdin?

share|improve this question

migrated from Oct 8 '12 at 5:52

This question came from our site for system and network administrators.

What are the nano versions in those distributions? Maybe the different behavior comes from an older version.. – daniel kullmann Oct 8 '12 at 6:45
If your shell is bash try with process substitution: nano <( ls ). – manatwork Nov 12 '12 at 14:13

2 Answers 2

up vote 2 down vote accepted

The feature wasn't added until version 2.2

For version 2.2:

  • Allow nano to work like a pager (read from stdin) [DONE]

and CentOS6 uses nano-2.0.9-7 (

If you decided you want the latest version, you can download from the upstream site ( and then follow the Fedora guide to build your own RPM. (

share|improve this answer
Thanks for answering this old question :^) – Quolonel Questions Apr 5 '14 at 11:22

I think that this is text editor "feature" and nano doesn't have that.

you can use 2 steps:

ls > output.txt
nano output.txt

There are 2 other editors which can use stdin for data input

ls | joe
ls | jed
share|improve this answer

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.