Day 3 Task: Basic Linux Commands

To view what's written in a file.

Cat <Filename.txt>

To change the access permissions of files.

chmod 777 <Filename.txt>

To check which commands you have run till now.

History

To remove a directory/ Folder.

rm -r <File name.txt/Directory name>

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.

cat >> <Filename.txt>

▶ To Show only top three fruits from the file.

head -n 3 <Filename.txt>

▶ To Show only bottom three fruits from the file.

tail -n 3 <Filename.txt>

▶ 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, Grey.

cat >> <Filename.txt>

▶ To find the difference between fruits.txt and Colors.txt file.

diff <Filename.txt> <another Filename.txt>