To create a file.
How to write text in a file.
-> You can write using the cat command inside the file. For save and exit you have to press enter after where your text ends and after that press "ctrl+d"
-> You can also use the echo command for writing the text inside the file.
To view what's written in a file.
-> cat command has three functionalities -> 1. create 2. view 3. concatenation
To check the permission configuration of a file
-> Here first dash(-) shows the type of file
-> "rw-rw-r--" show permission for the file in which the first rw- tells about the user permission. Second rw- tells about the group permission and third r-- tells about the permission of others.
-> 1 tells about how many links of this file.
-> First "ubuntu" shows the owner of the file and the second "ubuntu" shows who is owing the group.
-> Date and time show the last modification time of the file.
-> In the last it shows the file name.
To change the access permissions of files.
-> Three types of permission r(read),w(write), and x(execute). we can use their numerical value for their permission. Value of r=4, w=2, x=1, and for the no permission value is 0.
-> By summing their value we can simply use one number.
For read, write, and execute value is 7.
For read and write value is 6.
For read and execute value is 5.
For read-only value is 4.
For write and execute value is 3.
For write-only value is 2.
For execute-only value is 1.
.
To create a directory.
To remove a directory/ Folder.
Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava. Also, assign the number to the entry.
.
Show only the top three fruits from the file.
Show only the bottom three fruits from the file.
To check which commands you have run till now.
To create a fruits.txt file and to view the content.
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, and Grey
-> By using the echo command we create the file and add the content in the file.
-> -e will enable the newline character(\n).
-> \n will create a new line while using the append mode(\>>) it will create the file if it doesn't exist and if it exists new content will appended to the end of the file without overwriting the existing content.
To find the difference between fruits.txt and Colors.txt file
-> diff command is used to show the difference between two files.
-> In this output: 1,5c1,8 shows the range of files where 1,5 shows the range of the first file fruit.txt and c we can say it as a comma between the first file and the second file where in the last 1,8 shows the range of the second file Colors.txt.
-> "---" It is a separator between both files.
These are some of the basic commands we use in DevOps there are many more advanced commands which we learn further in our journey.