Linux - chapter-4: Data and Editor Commands
A Comprehensive Guide to Data and Editor Commands in Linux

Software Engineer
we need to know linux commands before diving into DevOps concepts, as a DevOps engineer, it is necessary to acquire linux commands as it is a first and foremost skill to start with
There are different categories of Linux commands. In the previous chapter, we learned about file commands. Now, in Chapter 4, we will dive deep into Data and Editor commands. I will split the Linux commands into individual articles instead of covering everything in a single article.
4th chapter is data and editor commands:
as the name suggests, data commands in Linux are commands used to view, process, or manipulate data/content (like text or files).
editor commands in Linux are Commands used to create and edit files using text editors.
parenting folder creation:
mkdir -p folder1/folder2/folder3: creating folder3 directly inside other directories without creating them manually
cat > filename: to add the content in file by overwrite the previous data
cat >> filename: to append the new data in the file
cat filename: to read the file content.
cat -n a1: to see the data as numbered list in the file
Modifying Data:
Vim editor: used to modify any files on linux os. it has different modes:
command mode
insert mode
save and quit mode
command mode:
it is default mode in vim editor, it is used to copy, paste and move to specific line, replace the words or search the words and for delete.
yy: used to copy the entire line and enter p to print the line
4yy: copy multiple lines, copy 4 lines from where cursor is there
10p: print the line 10 times
dd: delete the line
9dd: delete the 9lines from where our cursor is.
G: to move the cursor to the last line.
gg: to move the cursor to the first line.
M: to move the cursor to the middle of the line.
4gg: to move the cursor to the 4th line. or :4
G: to move the cursor to the last line.
u: undo all the changes.
CTRL + r: redo all the changes.
u: undo all the changes.
Search the word:
/: used to search for a word in file
**%s/old/new/g :**used to replace the old word with new word globally (s means string)
/: used to search for a word in file
Insert Mode:
used to insert the data in a file
i: used to go to insert mode
q: used to quit from vim editor.
:wq - save and quit
:wq! - save and quit forcefully
:w - save the data in file
:q! - forcefully quit without saving
A: to move the cursor to end of the line
I: to move the cursor to start of the line




