Linux Command Line Essentials: Boosting Your Productivity and Efficiency

Linux Command Line Essentials: Boosting Your Productivity and Efficiency

I'm excited to share my first blog post as a task submission for Day 3 #90DaysOfDevOps Challenge. Join me on this exciting journey of unlocking the potential of Linux!

In this blog, we delve into the Linux command line essentials that will supercharge your productivity and efficiency. Discover the power and flexibility of the command line interface as we explore fundamental commands, practical tips, and advanced techniques. Whether you're a Linux newcomer or an experienced user, this guide will equip you with the necessary skills to navigate, manipulate, and automate tasks using the command line.

Linux Architecture

LINUX Arch

  1. Kernel: Kernel is the core of the Linux-based operating system. It virtualizes the common hardware resources of the computer to provide each process with its virtual resources. Different types of the kernel are:

    • Monolithic Kernel

    • Hybrid kernel

    • Exo kernel

    • Nano kernel

    • Microkernel

  2. System Library: It is the special types of functions that are used to implement the functionality of the operating system.

  3. Shell: It is an interface to the kernel which hides the complexity of the kernel’s functions from the users. It takes commands from the user and executes the kernel’s functions.

  4. Hardware Layer: This layer consists of all peripheral devices like RAM/ HDD/ CPU etc.

  5. System Utility: It provides the functionalities of an operating system to the user.

Day 3 Task: Basic Linux Commands

Task: What is the Linux command to

1. To view what's written in a file.
2. To change the access permissions of files.
3. To check which commands you have run till now.
4. To remove a directory/ Folder.
5. To create a fruits.txt file and to view the content.
6. Add content in fruits.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
7. To Show only top three fruits from the file.
8. To Show only bottom three fruits from the file.
9. To create another file Colors.txt and to view the content.
10. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
11. To find the difference between fruits.txt and Colors.txt file.

Solution

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

    • cat filename

To change the access permissions of files.

  • chmod 777 filename

To check which commands you have run till now.

  • history

To remove a directory/ Folder.

  • rm -rf foldername/

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

  • vim fruits.txt

  • cat fruits.txt

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

  • echo -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > fruits.txt

To show only the top three fruits from the file.

  • head -3 devops.txt

To show only the bottom three fruits from the file.

  • tail -3 devops.txt

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

  • nano filename.txt && cat filename.txt

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

  • echo -e "Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" > Colors.txt

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

  • diff fruits.txt Colors.txt

Did you find this article valuable?

Support Dhanashri's DevOps Corner by becoming a sponsor. Any amount is appreciated!