Linux Fundamentals WEEK 1 (File and user management)

Linux Fundamentals WEEK 1 (File and user management)

Getting Started with Linux Fundamentals: My Journey So Far

Over the past week, I decided to dive into the world of Linux and get a solid grasp of its fundamentals. I’ve always heard how crucial Linux is in the tech world, and I figured it was time to roll up my sleeves and get hands-on with it. Here’s what I’ve learnt so far:

Basic Commands

Learning the basic commands was my first step. These are essential for navigating and managing files and directories in Linux. Some of the commands I’ve explored include:

  • cd: To change directories. This is your go-to for moving around the file system.

  • whoami: A quick way to check which user is currently logged in.

  • clearTo clean up the clutter on your terminal.

  • pwd: Prints the current working directory, so you always know where you are.

  • touch: Creates new files effortlessly.

  • mkdir and rmdir: To create and remove directories, respectively.

  • rm: Deletes files, but you need to be cautious with this one!

  • cp and mv: For copying and moving files or renaming them.

  • nano and vi: Text editors to create and edit files directly from the terminal.

  • ls: Lists files in the current directory, with variations like ls -a for hidden files and ls -l for detailed information.

File Viewing and Searching

Viewing and searching files effectively is another key aspect of Linux. Here are some useful commands I’ve picked up:

  • cat, more, and less: These help view file contents, each with slightly different functionality.

  • head and tail: Display the first or last few lines of a file, with options to specify the number of lines.

  • nl: Shows file contents with line numbers.

  • find and locate: For searching files and directories. find offers advanced options like filtering by modification time, while locate is faster but relies on an updated database.

  • which, man, and whereis: Help locate executable files and view their documentation.

File and User Permissions

Permissions are at the heart of Linux’s security. Understanding and managing these permissions was both challenging and rewarding. Here’s what I learnt:

  • File permissions are categorised for owners, groups, and others. You can read (r), write (w), or execute (x) based on these permissions.

  • Commands like chmod allow you to modify these permissions easily. For example, chmod u-r <filename> removes read access for the user.

  • Ownership can be changed with chown, and groups can also be set using the same command.

User and Group Management

Managing users and groups is another critical skill in Linux. Here are the commands I practiced:

  • sudo useradd <username> -m: Creates a user along with a home directory.

  • sudo passwd <username>: sets or changes the password for a user.

  • su -<username> and exit: Switch between users and return to the original session.

  • sudo groupadd <groupname>Creates a new group.

  • sudo usermod -aG <groupname> <username>: Adds a user to a specific group.

  • groups <username>Displays the groups a user belongs to.

Understanding how to create and manage links was particularly interesting. I learnt:

  • ln -s: Creates symbolic links.

  • ln <filepath> <filepath>: Creates hard links.

Reflections and Next Steps

This week has been incredibly insightful. Mastering these basics has given me a solid foundation to build on. Linux is vast, and there’s so much more to explore—from scripting to advanced server management. Next, I’m planning to dive deeper into shell scripting and explore more about file systems and process management.

For anyone starting with Linux, my advice is to practice as much as possible. The terminal might feel intimidating at first, but the more you use it, the more intuitive it becomes.

I’ll continue to share my progress as I learn. If you have any tips or resources, feel free to share them with me. Let’s keep learning together!

GitHUB link for reference: github.com/Parthasarathy-G/Linux-fundamendals