Day 3: Basic Linux commands
- Linux command to view what’s written in a file.
#cat command is used to display what’s written in a file.
2. Linux command to change the access permissions of files.
#chmod command is used to change the access permissions of files
3. Linux command to check which commands you have run till now.
#history command is used to check which commands you have run till now
4. Linux command to remove a directory/ Folder.
#rmdir command is used to remove a directory/ folder .
5. To create a fruits.txt file and to view the content.
#vim fruits.txt is used to create a fruits.txt file and to view the content.
6. Add content in devops.txt (One in each line) — Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
Use command #vim devops.txt and add fruits name one by one.
7. To show only top three fruits from the file
#cat devops.txt | head -3 is used to show only top three fruits from the file
8. To Show only bottom three fruits from the file.
#cat devops.txt | tail -3 is used to show only bottom three fruits from the file
9. To create another file Colors.txt and to view the content. Add content in Colors.txt (One in each line) — Red, Pink, White, Black, Blue, Orange, Purple, Grey
Use command #vim Colors.txt and add colors name one by one.
10. To find the difference between fruits.txt and Colors.txt file.
#diff fruits.txt colors.txt is used to find the difference between fruits.txt and Colors.txt file.