Text Editors and Converters
There is a difference between text files in Windows, MacOS and Linux.
The end of the line in text files is a different character for each O.S - the
line terminator
.Win -
\n
MacOS - (control)
Linux - (line feed)
Commands
file
file
- determine file type
Converting files with dos2unix/unix2dos tools:
dos2unix
dos2unix
/unix2dos
Editors
nano
nano
- small editorpening multiple files, scrolling per line, undo/redo, syntax coloring, line numbering, and soft-wrapping overlong lines.
Press
CTRL+G
to enter the Help menuPress
ALT+X
to disable Help modeScroll with
PgUp
andPgDown
keysPress
CTRL+C
to find the cursor locationUndo a change with
ALT+U
ALT+A
start a selection at the current cursor location and move the cursorALT+6
to copy the selected textCTRL+U
to paste the copied textCTRL+W
to search content -ALT+W
/ALT+Q
to keep searching for the same contentCTRL+O
to save fileCTRL+X
to exit file
vim
vim
- Vi IMproved text editor
📌 Check the VimHelp manual for more advanced Vim functionalities.
Normal mode command
:help x
Visual mode command
v_
:help v_u
Insert mode command
i_
:help i_<Esc>
Command-line command
:
:help :quit
Command-line editing
c_
:help c_<Del>
Vim command argument
-
:help -r
Option
'
:help 'textwidth'
Regular expression
/
:help /[
Press
i
for insert modePress
ESC
key to exit insert modeExit vim with
:q
Exit without save with
:q!
Save and exit with
:wq
Search with
/text_to_search
n
/N
to scroll through searching
Last updated