Skip to main content

Command Palette

Search for a command to run...

#90DaysDevOpsChallenge

Updated
•2 min read•View as Markdown
#90DaysDevOpsChallenge

#Day3Task: Basic Linux Commands

Task: What is the Linux command to

  1. To view what's written in a file.

cat "file_name

  1. To change the access permissions of files.

now we understand about the permissions of the file there will be 3 types of permission that are rwx

r= read

w=write

x= execute

if we want to change permission then us ( chmod )

  1. To check which commands you have run till now.

  2. To remove a directory/ Folder.

rm: command helps us to remove directory/ Folder.

  1. To create a fruits.txt file and to view the content.

through touch command we can create fruits.txt if we want to view the content then we use "cat fruits.txt"

  1. Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.

Add content in devops.txt then we can use command vi devops.txt then press i button its open as insert mode then write "Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava."

  1. To Show only top three fruits from the file.

head command help us to view top three line from the file

  1. To Show only bottom three fruits from the file.

tail command helps bottom three fruits from the file.

  1. To create another file Colors.txt and to view the content.

using touch command To create another file Colors.txt and to view the content using "cat Colors.txt" .

  1. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.

add content on the Colors.txt use "vi" command

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

diff -c fruits.txt Colors.txt file.