Essential Linux Commands: A Beginner’s Guide to Navigating and Managing Your Virtual Machine

Introduction To Linux: User Permissions In Linux.
Introduction
Working with a Linux Virtual Machine (VM) is a fundamental skill for developers, system administrators, and DevOps engineers. Whether you’re managing servers, deploying applications, or simply practicing Linux commands, knowing how to navigate and perform essential operations in a VM is crucial.
In this guide, we’ll walk through step-by-step instructions on how to set up and manage files, directories, and user permissions inside your Linux VM. You’ll learn how to update packages, create and edit files, assign permissions, add new users, and even transfer ownership of files. These commands form the foundation of Linux administration and will help you build confidence in working directly from the terminal.
By the end of this walkthrough, you’ll not only understand how to manage your Linux environment more effectively but also gain hands-on experience with best practices that will make your day-to-day operations smoother and more secure.
Open your Linux Virtual Machine.

Click and open your Linux terminal.
Run - sudo su - To enter your root account.
Enter your password, and you are in.

Run - apt update To update virtual machine packages…. Advice to do this frequently when you login.
If it fails to go through…Run - systemctl daemon-reload and Run - apt update again.

Run - mkdir (your folder name) TO create a new folder.
Run - cd (your folder name) TO enter your folder / Run - cd .. To come out of a path.
To see your newly created folder manually, navigate to the file explorer and click on it.
Click on other locations, click on Ubuntu, and click on the root folder.
Insert your password and click on enter….You will find your new folder in there.
Run - touch (filename.html) Note, you can use any of the files. To create a new file.
Run - ls To check into your folder.
Run - ls -l To see the permissions you have for your file. Note, the rw-r-r the first (rw) is for the owner, (r) is for the group, and (r) is for the third parties.

Run - chmod u+x (your filename.html) To change your mode of permission with (x), which is the right to execute. .html) To change mode with execution for all, using the following chmod cheat sheet.


Run - ls -al To see the hidden folders.

Run - vi or vim (your filename.html) To access your file text editor and write in it.
To be able to type, you need to type i (insert mode) first. then write your code or content.
Go and get your web app code and paste it.
You can Run - echo quote and write what you want to within your file without using vi or vim in the text editor (e.g, echo ‘welcome to linux class‘ > (your filename.html). It will replace the content inside your file.

To save and exit, type esc:wq and enter.
Run - cat (your filename.html) To view what’s inside your file without needing to vi or vim into the text editor.
How To Create And Add A User To Have Access To Your File
Run - adduser (your username) Info. will be added, then create a password for the user and add his full name e.t.c.

Run - cat /etc/passwd To check if the user is successfully added……you can see the user in the last line
Run - cat /etc/passwd/group To see it more streamlined……also To know your username and the team usernames.
Run - su - (the username) To enter the user’s account… You can only do this as a root user.

To Give A User Ownership To A File
Run - cd (foldername) To enter the folder where the file is located.
Run - ls -l To see the root permissions.
Run - chown (the username:root filename) To add ownership of the file to the user.
Run - history To see all commands you’ve ran
Extra
To install the Vim text editor on your terminal, Run - apt install
Run - d1 or dd To delete a particular line / d10 to delete 10 lines.
SUCCESS…..
Join me on this cloud adventure and elevate your tech skills! Sign in to the Azure portal, follow my easy instructions, and unleash the power of being in the cloud.
Subscribe to my blog for more tech tips and tricks that will keep you ahead in the digital game. Your journey to mastering Cloud computing starts here!
🌟 Thank you for being a part of this incredible journey! Together, let's unlock new opportunities and make the most out of our digital experiences. Happy computing! 🌟




