Essential Linux Concepts

14 Mar 2024 - Vishal Srivatsava AV

Welcome back to our Linux learning journey! In this week’s edition, we’ll continue exploring essential concepts in Linux system administration.

Building upon the foundation laid out last week, we’ll delve into three key areas: Package Management, User and Group Management, and Permissions and Ownership.

Package Management in Linux

Package management is a method for installing, upgrading, configuring, and removing software in Linux. It ensures that software dependencies are resolved, and packages are installed in a consistent manner.

Package Managers

Different Linux distributions use different package managers. Here are a few examples:

Basic Commands

Here are some basic commands for APT:

  • sudo apt update: Updates the list of available packages and their versions.
  • sudo apt upgrade: Installs available upgrades of all packages currently installed on the system.
  • sudo apt install <package_name>: Installs a package.

User and Group Management in Linux

In Linux, users are individuals who use the system, while groups are a way to organize users.

User Management

  • useradd <username>: Creates a new user.
  • passwd <username>: Sets or changes the password for a user.
  • userdel <username>: Deletes a user.

Group Management

  • groupadd <groupname>: Creates a new group.
  • usermod -aG <groupname> <username>: Adds a user to a group.
  • groupdel <groupname>: Deletes a group.

Permissions and Ownership in Linux

Linux is a multi-user environment, so it has extensive permissions and ownership settings to control access to files and directories.

Understanding Permissions

In Linux, each file and directory has three types of permissions:

  • Read (r): The file can be opened and read.
  • Write (w): The file can be modified.
  • Execute (x): The file can be executed as a program.

Changing Permissions

The chmod command is used to change permissions:

  • chmod u+x <filename>: Gives the user (u) execute (x) permission.
  • chmod g-w <filename>: Removes write (w) permission from the group (g).

Changing Ownership

The chown command is used to change ownership:

  • chown <username> <filename>: Changes the owner of the file to the specified user.

Conclusion

Understanding package management, user and group management, and permissions and ownership is crucial for effective Linux administration. With these concepts under your belt, you’ll be well on your way to mastering Linux!

Please note that this is a simplified overview and actual usage may require additional options and parameters. Always refer to the man pages (man command) for comprehensive documentation. Happy Linux journey!

Next Week👀

The following content will be covered:

  • File Manipulation Commands
  • Process Management
  • Networking Basics