Linux command to:
- To view what's written in a file
cat file.txt
- To change the access permissions of files
chmod
To check which commands you have run till now
history
- To remove a directory/ Folder
rmdir
- To create a fruits.txt file and to view the content.
cat > fruits.txt to exit press ctrl+d
Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
cat > fruit.txt Apple Mango Banana Cherry Kiwi Orange Guava to exit press ctrl+d
7. To Show only the top three fruits from the file
head -3 fruits.txt
8. To Show only the bottom three fruits from the file
tail -3 fruits.txt
To create another file Colors.txt and to view the content
cat > Colors.txt
10. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey
cat > Colors.txt Red Pink White Black Blue Orange Purple Grey to exit press ctrl+d
- To find the difference between the fruits.txt and Colors.txt file
diff fruits.txt Colors.txt
Thanks for watching my blog
I hope you like it