Mastering Linux Essentials: Root Directory, User Management, and Package Installation

Understanding the Root Directory in Linux

The root directory (/) is crucial in Linux, serving as the top-level of the filesystem hierarchy. Access to this directory is restricted to administrative users, commonly referred to as "root."

Creating Users in Linux

In Windows, creating a new user involves navigating through Computer Management.

In Linux, the process is streamlined using commands:

  1. Creating a User:

    • Use sudo adduser –m raees to create a new user named "raees."

    • Set a password with sudo passwd raees.

  2. Switching Users:

    • Use su raees to switch to the user "raees."

    • To switch to root, use sudo su.

Installing Packages or Tools

Installing software like Docker or Snap Store is straightforward:

  1. Updating and Upgrading:

    • First, ensure your system is updated:

        sudo apt-get update && sudo apt-get upgrade
      
  2. Installing Snap Store:

    • Install Snap Store with sudo snap install snap-store.

Managing Software Installations

To remove Snap Store, use sudo apt purge snap-store. Other essential commands include:

  • Viewing File Content: Use cat file.txt.

  • Editing Files: Use vim file.txt for editing.

  • Viewing Lines of a File: head file.txt -n 2 displays the first 2 lines, while tail file.txt -n 2 shows the last 2 lines.

  • Navigating Home: cd ~ takes you to the home directory.

Today's insights contribute to mastering Linux administration. Enjoy learning and share the knowledge with others. Stay tuned for more informative blogs!

0
Subscribe to my newsletter

Read articles from Raees Yaqoob Qazi directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Raees Yaqoob Qazi
Raees Yaqoob Qazi