☑️Day 8:  Hands-On Practice with Essential Linux Commands

☑️Day 8: Hands-On Practice with Essential Linux Commands

Hello DevOps Enthusiasts,

As I progress through Day 8 of my DevOps journey, I’m realizing more than ever how critical Linux is to a DevOps engineer's daily tasks. From managing files and permissions to understanding the concept of users and efficiently navigating the file system, the power of Linux commands cannot be overstated.

Today, I’m focusing on key concepts like users, file paths, permissions, and some essential commands to streamline system management. If you want to level up your Linux skills, I encourage you to spend a productive hour practicing these commands.


Understanding Linux Users

Linux users play a vital role in system security and task execution. Here's a breakdown of the types of users in Linux:

  • Regular User: The standard, non-admin user with limited permissions.

  • Root User: The "superuser" with full control over the system, capable of running any command.

  • Service User: Accounts created for services (like www-data for web servers) that help run specific tasks without granting broad system access.


✅Absolute vs. Relative Paths

Navigating the Linux file system can be done using either absolute or relative paths:

  • Absolute Path: The full path from the root /. For example, /home/kedar/projects.

  • Relative Path: Refers to the path relative to the current directory. For example, if you are in /home/kedar, running cd projects moves you to /home/kedar/projects.


✅User Permissions: Read, Write, Execute

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

  1. Read (r): Allows a user to view the contents of a file.

  2. Write (w): Grants permission to modify a file.

  3. Execute (x): Allows a user to run a file as a program or script.

To see file permissions, use the ls -l command. The output will look like this:

-rwxr-xr--

The first set of characters indicates the permissions for the owner, group, and others.


✅Using chmod for Permission Changes

You can modify file permissions using the chmod command. Here's an example:

chmod 755 my_script.sh

This gives the owner full permissions (read, write, execute), while the group and others get only read and execute permissions.


✅Essential Linux Commands to Practice

Now let’s dive into the key commands that will improve your system management skills:

  • cp: Copies files or directories.

    • Example: cp source.txt destination.txt to copy a file.

  • mv: Moves or renames files.

    • Example: mv file.txt /home/user/ to move a file.

  • touch: Creates an empty file or updates the timestamp.

    • Example: touch newfile.txt to create a new file.

  • ls -R: Recursively lists all files and directories.

    • Example: ls -R to see everything under the current directory.

  • history: Displays the command history for your session.

    • Example: history | grep chmod to find past chmod commands.

  • sudo: Run commands with root privileges.

    • Example: sudo apt-get update to update packages with admin rights.

  • kill: Terminates processes using their process ID (PID).

    • Example: kill 1234 to kill a process with PID 1234.

  • ps: Displays active processes.

    • Example: ps -a to list all active processes from all users.

  • top: Provides a real-time view of system processes and resource usage.

    • Example: Just type top and watch the system resources dynamically update.


✅Why These Commands Matter in DevOps

For a DevOps engineer, efficient management of files, permissions, and processes is essential. Whether you’re managing servers, setting up CI/CD pipelines, or automating scripts, knowing how to navigate and control a Linux system is key to success.

By mastering these commands, you’ll:

  • Improve system security by controlling file permissions.

  • Be able to troubleshoot and kill unresponsive processes.

  • Save time by efficiently navigating through directories and managing files.


🚀Stay tuned for more updates on my DevOps journey! 📅

Feel free to reach out to me if you have any questions or need any more help. Let’s connect, learn, and succeed together!

Thanks for joining me on Day 8 of this exciting journey. Let’s keep leveling up our skills, one productive hour at a time!

Happy Learning!😊

#90DaysOfDevOps

💡
Follow for more updates on LinkedIn , Github and Twitter(X)