Table of contents
- Commands to:-
- To view what's written in a file
- To change the access permissions of files- done by using the "chmod" command.
- How to check which commands have been used till now ?
- To remove a directory/ Folder.
- To create a fruits.txt file and to view the content.
- Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
- Show top three fruits from the file
- Show bottom three fruits from the file
- Create another colors.txt file and view its content
- 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.
- Conclusion:-
#Day3 in 90 days of DevOps.
Table of Contents:-
To change the access permissions of files - done by using "chmod" Command.
Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
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.
Commands to:-
To view what's written in a file
cat [filename]
To change the access permissions of files- done by using the "chmod" command.
In Linux there are 3 permissions of every file i.e. read(r), write(w), execute(x), also we can permit users in a user group and other manner.
u : owner permission + : add permission
g : group permission - : remove permission
o : other user permission = : assign permission
Syntax to change access permission in file-
chmod <u,g,o><+,-,=><r,w,x> <filename>
How to check which commands have been used till now ?
history
To remove a directory/ Folder.
To remove a directory with its contents, use rmdir -r
Command to delete forcefully all the data, rmdir -rf
rmdir option [foldername]
To create a fruits.txt file and to view the content.
touch fruits.txt
cat fruits.txt
Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
Create the file using touch command.
touch [filename]
pen vi editor and add (Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava), one in each line.
NOTE: Press "i" to enter into insert mode.
now type ":wq" to save
Now give the cat command to see the content of the file:
Show top three fruits from the file
Show bottom three fruits from the file
Create another colors.txt file and view its content
touch colors.txt
cat colors.txt
Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
open vi editor, press " i " to enter into "insert mode" and add Red, Pink, White, Black, Blue, Orange, Purple, and Grey (One in each line), and press " :wq " to save.
To find the difference between fruits.txt and colors.txt file.
To compare the contents of two files, use the diff
command.
diff fruits.txt Colors.txt
Conclusion:-
It’s not about perfect, it’s about effort, and when you bring that effort every single day, that’s where transformation happens, that’s how change occurs.
Linux commands open a world of possibilities. Practice is the key to mastering the Linux and DevOps.