1. To view what's written in a file.
--> cat <filename>
2. To change the access permissions of files.
--> chmod 777 <filename>
3. 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.
-->touch fruits.txt
-->cat fruits.txt
- Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
--> vi devops.txt [press i for insert include Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.] save it with wq!
--> cat devops.txt
7. To Show only top three fruits from the file
--> head -n 3 devops.txt
To Show only bottom three fruits from the file.
--> tail -n 3 devops.txt
9.To create another file Colors.txt and to view the content.
-->touch Colors.txt
-->cat Colors.txt
-->diff colors.txt devops.txt
Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
--> echo "red/nPink/nwhite/norange/n > Colors.txt"
>place standard input into the file
To find the difference between devops.txt and Colors.txt file.
--> diff devops.txt Colors.txt
uname: It shows the name of the kernel
whoami: Shows current login user
date: shows date and time
mkdir file{1..10}: create 10 files with the given namespace
useradd devops: Create user devops
grep devops/etc/passwd: To check account properties
passwd devops: To create an account password
su: To switch the user
exit: logout user
userdel devops: to delete the user devops
head file: Top 10 lines of the file will be printed
tail file: Bottom lines of the file will be printed [tail -n 3 <filename>]
Thank you for reading this Blog. Hope you learned something new today! If you found this blog helpful, please like, share, and follow me for more blog posts like this in the future.
I would like to connect with you at linkedin.com/in/madhuri-patil-278b19118