Windows 11 brings Linux Sudo to Command Prompt and PowerShell

You can now run commands and tools using the Linux "sudo" command on Windows 11.

Windows 11 Enable sudo option
Windows 11 Enable sudo option / Image: @thebookisclosed
  • Microsoft is adding an option to enable “sudo” from the “For developers” page in the Settings app of Windows 11.
  • The feature will be available through the Windows Terminal when using Command Prompt, PowerShell, and other command consoles.
  • The command works the same as the Linux sudo command, but you can decide how to run apps with the command.

UPDATED 2/13/2024: Windows 11 integrates the “sudo” command on PowerShell and Command Prompt, similar to the command already available in Linux, macOS, and other Unix-based operating systems. The feature is now available inside the preview builds of Windows 11 through the Canary Channel, and Microsoft is making it an open-source project.

What is the sudo command?

The sudo (superuser do) command allows users to run programs and tools with the security privileges of another user (the superuser or administrator, by default). It’s a ubiquitous feature in Linux, macOS, and other Unix-based operating systems for managing permissions and executing commands that require elevated privileges.

Linux sudo command
Linux sudo command / Image: Mauro Huculak

Introducing native sudo command support on Windows 11 further shows Microsoft’s ongoing efforts to bridge the gap between Windows and Unix-like operating systems.

How does sudo work on Windows 11?

The integration of the command is similar to the one on Linux. Users can invoke the sudo command in the Windows Terminal to execute commands with administrative privileges without the need to switch user accounts, making it easier to manage system configurations and perform secure operations.

Enable sudo command
Enable sudo command / Image: Mauro Huculak

To enable the option, you have to open Settings > System > For developers and turn on the “Enable sudo” toggle switch. Then, you have to use the “Configure how sudo runs applications” settings to choose the experience. For example:

  • In a new window: When running the sudo command, the terminal will open a new window to run commands with administrative privileges.
  • With input disabled: It runs the command in an elevated mode in the current window, but the process won’t have any more inputs. If you have to run additional processes, this mode won’t work. (This is the most secure experience.)
  • Inline: When running the sudo command, the terminal will allow you to execute administrative tasks within the same window.

It’s also possible to enable sudo with commands with the sudo confirm --enable sudo-mode command. The sudo modes available include normal, disableInput, and forceNewWindow.

Once the feature is enabled, the sudo command should work on Command Prompt and PowerShell.

Why is Microsoft bringing sudo to Windows 11?

The addition of the sudo command to Windows 11 is part of a broader strategy to enhance the operating system’s appeal to developers, network administrators, and power users who rely on Linux tools for their work. By integrating Unix-like commands directly into the operating system, the company aims to eliminate barriers to productivity further and promote a more versatile and robust environment for software development and system administration.

“Sudo” is not the only non-Windows command available in the operating system. For example, in the stable version, you can already use the tar and curl tools. The “tar” tool allows you to extract files and create archives, while the “curl” tool to transfer files between servers.

When will the Linux command be available on Windows 11?

The company is gearing up to release Windows 11 24H2 later in the year, which is said to include a vast of new features and changes, and the sudo command could be one of the features planned for this release. On the other hand, Microsoft is also known to drop features as soon as they’re ready outside new version releases, so it could also be the case that the company may roll out the feature during a regular monthly update.

What are your thoughts on the new Linux command coming to Windows 11? Share your thoughts in the comments.

Update February 13, 2024: This guide has been updated to reflect that the feature is already available for testing in the latest preview of Windows 11.

About the author

Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication. He has also been a Windows Central contributor for nearly a decade. Mauro has over 15 years of experience writing comprehensive guides and creating professional videos about Windows and software, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 21 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter), YouTube, LinkedIn and Email him at [email protected].