90DaysOfDevops
Ravi Srivastava
AWSAnalyst @ Reput.ai| AWS Certified Solutions Architect Associate| IAM | SSO | SAML| Control Tower | Aws Organization| Keycloak| MinIO|AWS Workspace|Grafana
Day-3 Task
- To view what's written in a file.
There are 3 ways to view what's written in a file.
Command--> cat filename
nano filename
vim filename
- To change the access permissions of files.
if you run ls -l, it will show the permissions, owner, size, and last modified date for each file in the directory.
Chmod: This command is used to change the access permissions of files and directories.
For example: Following “chmod†command will give the user permission to read, write and execute a file.
- To check which commands you have run till now.
you just need to use a command i.e history
- To remove a directory/ Folder.
There are 2 ways which i know rmdir directoryname or rm -r directoryname
- To create a fruits.txt file and to view the content.
There are 3 ways or Commands to create and view the content
For Creation For Viewing
touch fruits.txt cat fruits.txt
nano fruits.txt nano fruits.txt
vim fruits.txt vim fruits.txt
- Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
for adding content in Devops.txt i used nano file editor
领英推è
for example nano Devops.txt this command will open the file then simply add the content like : Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava
after adding content press ctrl+x then Y for yes it will save the file and then hit Enter.
- To Show only top three fruits from the file.
Command ---> head -3 filename
for example head -3 Devops.txt
- To Show only bottom three fruits from the file.
Command ----> tail -3 filename
for example tail -3 Devops.txt
- To create another file Colors.txt and to view the content.
i use again nano command for ex-. nano colors.txt
for view the content cat colors.txt
- Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
i use again nano command for ex - nano colors.txt and enter the content
- To find the difference between fruits.txt and Colors.txt file.
Solution --> diff fruits.txt Colors.txt