Devops Day3
Task as per 3rd days of 90 Days of Devops Series
To view what's written in a file.
We use the Cat command to see what's written in file
To change the access permissions of files.
The chmod command to change the permission of file,
Following “chmod” command will give the user permission to read, write and execute a file
3 . To check which commands you have run till now.
History command is used to check whatever commands we have ran till now
4. To remove a directory/ Folder.
rm command is used to remove directory/Folder, along with rm, we user flag rf r for recursive and f for forcefully.
5. To create a fruits.txt file and to view the content.
touch, command is used to create a file.
cat command, cat <file_name>, is used to see the contents of the file
- Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
To Show only the top three fruits from the file.
head command is used to see the content of file from top
head -<number of lines to see> <File name>
-
To Show only bottom three fruits from the file.
tail command is used to see the content of file from bottom
tail -<number of line> <file name>
To create another file Colors.txt and to view the content.
touch <file name>, is used to create a file
Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
To find the difference between fruits.txt and Colors.txt file.
diff command is used to show the difference in 2 files
diff <filename1> <filename2>