Skip to main content

Command Palette

Search for a command to run...

More Basic Linux Commands

Published
•1 min read•View as Markdown

Day 3 of 90 Days of DevOPS

To view what's written in a file use cat

  1. To change the access permission files use: chmod

  2. To check commands you have run until now use: history

  1. To remove a directory use: rmdir

However, if directory is not empty, we must empty it first and then we can delete. We use rm -r to accomplish this

  1. Let's create a fruits.txt file use: touch fruits.txt

    now use cat fruits.txt to view content

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

  2. To Show only top three fruits from the file use: head -n 3 fruits.txt

  3. To Show only bottom three fruits from the file use: tail -n 3 devops.txt

Create another file Colors.txt and view the content:

use: touch Colors.txt and use cat Colors.txt

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

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