Skip to main content

Command Palette

Search for a command to run...

Linux Commands:~ First step towards DevOps Engineering Part:- 1

Updated
2 min readView as Markdown
Linux Commands:~ First step towards DevOps Engineering Part:- 1
S

DevOps Enginner

ls: List the contents of a directory

ls

pwd: Print the current working directory.

pwd

touch: Create New file.

touch hello.txt

vim: Text editor with normal, insert, and command modes.

vim hello.txt

Insert Mode: To start inserting text into the file, you need to switch to Insert mode. There are a few ways to enter Insert mode:

  • i: Press i to enter Insert mode before the cursor position. You can start typing text at the cursor.

  • I: Press Shift + i to enter Insert mode at the beginning of the current line.

  • a: Press a to enter Insert mode after the cursor position. You can start typing text immediately after the cursor.

  • A: Press Shift + a to enter Insert mode at the end of the current line.

  • o: Press o to open a new line below the current line and enter Insert mode.

  • O: Press Shift + o to open a new line above the current line and enter Insert mode.

After Inserting inside the Vim editor Just write "Hello everyone, i am currently Devops"

To save changes and exit, you can use: use Esc and

:wq

cat: Concatenate and display files.

cat hello.txt

grep: Search for a string/word in a text file.

grep "hello" hello.txt

now Again use Vim editor, open hello.txt and write list of fruits inside editor

"

Apple, Banana, Orange, Strawberry, Blueberry, Grape, Pineapple, Mango, Watermelon, Kiwi, Peach, Pear, Cherry, Raspberry, Lemon, Lime, Avocado, Papaya, Cranberry, Blackberry.

"

sort: Sort results alphabetically or numerically.

sort hello.txt

tail: Display the last N lines of a file.

tail -n 10 hello.txt

ping: Check if a host is responding.

ping google.com

mkdir: For Creating a new folder.

mkdir helloworld

cd: For changing directory

cd helloworld

Now you can again create file and folder inside helloworld directory.

history: to check how many commands you use in your machine

history

for checking last 5 commands , you can use:-

history 5

More from this blog

Sidharth

40 posts