Terminal editors: nano and vim
Sign in to read this lesson
A server has no graphical editor, so configuration files are fixed in the terminal. nano is simple and shows hints on screen; vim exists on every Linux and is fast, but you need to know its modes. In this lesson we learn to open a file, change it, save it and quit in both.
What you will learn
nano file— type, thenCtrl+O(save),Ctrl+X(quit);Ctrl+Wsearches.- vim has modes: Normal (commands), Insert (typing, with
i), Command (with:). - Quitting vim:
Esc, then:wq(save and quit) or:q!(quit without saving). - In vim
dddeletes a line,uundoes,/wordsearches,:set numbershows line numbers. - Open a system file with
sudoeditorsudo nano; after a change run the service's own check.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.