Basic Linux commands
To view what's written in a file?
-->cat <file name>
To change the access permissions of files?
-->chmod 777 <file name>
To check which commands you have run till now?
-->History
To remove a directory/ Folder?
-->rmdir <folder name>
-->rm -r <folder name>
To create a fruits.txt file and to view the content?
-To create a fruits.txt file:
-->touch fruits.txt
to view the content of file:
-->cat fruits.txt
Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
-->vim devops.txt
1)to enable the insert option click on i key.
2)then add Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
3)press esc key to get out off insert mode,then press :x(save & quit).
to show only top 3 fruits from the file?
-->Head -3 devops.txt
to show only bottom 3 fruits from the file?
-->Tail -3 devops.txt
To create another file Colors.txt and to view the content?
-to create colour.txt file
-->cat > colours.txt
-to view content of file
-->cat < colours.txt
Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey?
--> cat > colours.txt
add the content
ctrl + d
To find the difference between fruits.txt and Colors.txt file?
-->diff colours.txt devops.txt
Thanks for giving your valuable time.