You can use the Linux “sudo” command in Windows 11: how it is activated and what you can do with it

0
1

The “sudo” command is a functionality well known to Linux users, as it allows you to execute administrative tasks safely. Starting with Windows 11 24H2, our operating system has added support for this command. It can be run from the command prompt and PowerShell, and in this article we are going to describe the steps so you can use it and what to do with it.

The “sudo” command (acronym for “superuser do”) has historically been used in Linux to execute commands with computer administrator privileges. This allows us to perform relevant actions for our PC, such as installing programs, modifying system settings and more delicate issues. All safely and with some control.

How to activate “sudo”

To start working with the command, we have to follow a few simple steps to enable it, in case it is not already enabled.

Open the Windows 11 Settings menu and go to the “System” tab. You will see the “For programmers” section. At the bottom of the menu, we must activate the “Sudo” functionality, as it appears in the image.

activate sudo

It is important to display the small window, right next to the activator, and select the “Aligned” mode.

We already have the canvas ready, now we just have to start working with it.

To start executing our command, we just have to access the command prompt. To access it, we just have to search for “Windows Terminal” in the Windows search box.

Once inside the command prompt, the first thing we will have to do is write the following command so that “sudo” guides us through its functions:

sudo -h

When you press Enter, a list will be displayed with the possibilities you have when using this functionality.

sudo commands

In any case, from Softzone we bring you a few commands to use with “sudo”:

«sudo apt update«. Updates the list of available packages for the command prompt.

«sudo apt install package-name«. It will help you install the type of software or tool you want.

“sudo chmod 755 file”. This sets the accessibility permissions for a file. Where it says “file”, you just have to replace it with the corresponding one.

«sudo systemctl restart service-name«. You can restart services to reconfigure them.

«sudo nano /etc/hosts«. Be careful with this command, as it allows you to modify sensitive files, such as the hosts file.

«sudo apt remove package-name«. Useful for removing applications.

These are just initial commands to get you rolling, but “sudo” allows you to perform much deeper tasks.

Apart from this, you can perform various tasks, such as managing software, automating processes, configuring environments such as Apache, MySQL or Node.js, or experimenting with Linux commands and configurations without leaving the Windows environment.

The integration of the “sudo” command turns the Windows 11 operating system into a platform more adapted for more advanced users. Many developers and students will be able to test Linux features from within Windows itself. This means that you will be able to run functions from an open source operating system in one that is not. Perhaps it is a mirage, and it does not have greater redundancy in the future, but it is a more than notable addition.

Previous articlePolice alerts the false manager’s scam: they send you an SMS to get your bank data
Next articleLinux is updated to support one of the latest Windows developments