Skip to main content

Command Palette

Search for a command to run...

Linux - chapter-4: Data and Editor Commands

A Comprehensive Guide to Data and Editor Commands in Linux

Updated
3 min read
Linux - chapter-4: Data and Editor Commands
B

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:

  1. mkdir -p folder1/folder2/folder3: creating folder3 directly inside other directories without creating them manually

  2. cat > filename: to add the content in file by overwrite the previous data

  3. cat >> filename: to append the new data in the file

  4. cat filename: to read the file content.

  5. cat -n a1: to see the data as numbered list in the file

Modifying Data:

  1. Vim editor: used to modify any files on linux os. it has different modes:

    1. command mode

    2. insert mode

    3. 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.

  1. yy: used to copy the entire line and enter p to print the line

  2. 4yy: copy multiple lines, copy 4 lines from where cursor is there

  3. 10p: print the line 10 times

  4. dd: delete the line

  5. 9dd: delete the 9lines from where our cursor is.

  6. G: to move the cursor to the last line.

  7. gg: to move the cursor to the first line.

  8. M: to move the cursor to the middle of the line.

  9. 4gg: to move the cursor to the 4th line. or :4

  10. G: to move the cursor to the last line.

  11. u: undo all the changes.

  12. CTRL + r: redo all the changes.

  13. u: undo all the changes.

Search the word:

  1. /: used to search for a word in file

  2. **%s/old/new/g :**used to replace the old word with new word globally (s means string)

  3. /: used to search for a word in file

Insert Mode:

used to insert the data in a file

  1. i: used to go to insert mode

  2. q: used to quit from vim editor.

  3. :wq - save and quit

  4. :wq! - save and quit forcefully

  5. :w - save the data in file

  6. :q! - forcefully quit without saving

  7. A: to move the cursor to end of the line

  8. I: to move the cursor to start of the line

Linux Commands every DevOps engineer should know

Part 4 of 7

This series breaks down Linux commands into clear categories such as system, hardware, and file commands. Each topic is covered in a separate article to make learning Linux simple, organized, and beginner-friendly.

Up next

Linux - chapter-3: File Commands

Mastering Linux File Commands with Practical Examples