Many of us may face a small problem with windows terminal (command line
) when going to execute some commands that require an admin privilege while the shell is opened in normal user privilege, so we have to restart the shell using Run As Administrator
in order to proceed, whilst in Linux we simply use sudo
command to execute whatever we want as a root user.
Here we have solution for this issue in Windows, just follow the following steps:
1- Using PowerShell
terminal execute the following command line to install scoop package installer:
C:\>iwr -useb get.scoop.sh | iex
2- Then after installing "scoop" in your system install "sudo" package:
C:\>scoop install sudo
Now you will be able to use sudo
command same as in Linux, for example in order to install npm package globally we have to run npm install
in a privilege mode:
C:\>sudo npm install –g bootstrap
As well as having a sudo
option in Windows, we will have the ability to install packages in Windows using "scoop" similar to apt
& apt-get
in Linux.
For more information how to use scoop visit :
Top comments (2)
thanks
Very much useful. Thanks for this information