#DevOpslearning #Devops #Devopsengineer
Topic-Deep dive into Linux basic commands.
- To view what's written in a file.
Command name-cat filename
- To change the access permissions of files.
Command name-chmod 777 foldername
- To check which commands you have run till now.
Command name-history
- To remove a directory/ Folder.
Command name-rm filename
- To create a fruits.txt file and to view the content.
touch fruits.txt
cat fruits.txt
- Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
Command name=echo -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > devops.txt
- Show only the top three fruits from the file.
Command name=head -n 3 devops.txt
8. Show only the bottom three fruits from the file.
Command name=tail -n 3 devops.txt
- To create another file Colors.txt and to view the content.
vim Colour.txt
cat Colour.txt
- Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, and Grey.
echo -e "Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" > Colors.txt
- To find the difference between fruits.txt and Colors.txt file.
diff fruits.txt Colors.txt
Here's an example of what the output might look like:
1c1
< Apple
---
\> Red
2c2
< Mango
---
\> Pink
3c3
< Banana
---
\> White
4c4
< Cherry
---
\> Black
5c5
< Kiwi
---
\> Blue
6c6
< Orange
---
\> Orange
7c7
< Guava
---
\> Purple
8c8
---
\> Grey
Shubham Londhe