I know nano
(and Pico!) well on *Nix systems, and don't even know how to get out of vi if it accidentally loads (though on emacs I can get that far. Questions about my intelligence aside, is it okay to expect that nano will be available on most Linux distributions I encounter?
3 Answers
vi is part of the posix standard, so it will be present on any Unix by definition. nano will be much more iffy. All you really need to know is :q!
to get out if it started accidentally, and then man vi
to find enough info to figure out how to use it if nothing else is available. Also vim is not vi and you cannot take vim features for granted either.
-
-
Justin, could you please put a link to the list of editors (or whatever) that are part of the posix standard? I looked around a bit and couldn't find anything definitive. Seems like emacs is also part? Feb 5, 2010 at 12:20
-
The full list of required user portable utilities: "bg ex fc fg jobs more talk vi", as specified on this page opengroup.org/onlinepubs/9699919799/basedefs/… defined by the POSIX2_UPE portion of the posix standard. emacs, sadly, is definitely not part of the posix standard, though any application can choose to implement posix guidelines for ie. how to interpet regex or command line arguments. Feb 5, 2010 at 20:23
-
Note that although any UNIX will have vi since it must have SUS certification which includes the presence of vi. But it'd be possible to have a Unix-like, non POSIX compliant OS without vi.– jinaweeFeb 24, 2019 at 14:29
Nope. It isn't. "vi" on the other hand is quite likely to be there. You may find "pico" if you're lucky. How to get out of vi:
:q!
Do a regular google search, as well as an image google search, for 'vi cheatsheet'.
-
2You can also do ZZ to save&quit, which is really useful (And easier to do than
:wq
)– PhoshiFeb 1, 2010 at 20:06
I haven't encountered a popular distro without it. So I think it's save to assume that.
-
3
-
This is true about Linux, but not about Unix, seems... I agree though, it's been on every Linux distro I've seen. Feb 1, 2010 at 23:28
-
IIRC, I have seen some without nano (red hat servers, I believe), but it is rare.– TrevokeFeb 2, 2010 at 13:19
vi
/vim
, but it's one of the best decisions I ever made. I'd recommend starting with thevimtutor
command, assuming your system hasvim
. (I know it's there on OS X and many Linux distributions I've used. Might not be there if you're using Ubuntu, though.)