Technology, Cloud computing and Automation…

Tag Archives: ps

Working with Bash on Windows, I can say that it significantly simplified the way I can work cross-platform. It has allowed me to use native Linux tools, when working with Linux systems, which is a big step up from using a mix of compiled for Windows Unix tools and GUI applications. Because of this unique functionality Windows 10 has a big lead over any other platform as my day-to-day platform.

For example it is possible to add a new Windows users account directly by using the net.exe tools:

1

net.exe user /add testaccount

net.exe user /add testaccount

Alternatively it is also possible to start Windows PowerShell in Bash to execute a command, for example it becomes possible to use PowerShell to determine which processes are running in the Windows environment and the ps command to determine what is running in Linux:

For me the greatest advantage is the fact that Windows executable files can also be directly called from bash, simplifying the interaction between the different OSes. An example of this is opening explorer in your current working folder in the bash terminal:

1

explorer.exe .

explorer.exe .

When a path is not accessible for the Windows application, for example anywhere in the Unix file system, a proper error message will be displayed:

1

explorer.exe .

explorer.exe .

Using this same method it is also possible to add the path to your favorite script editor to the Bash on Windows path allowing them to be directly called from the console. In the following example I will show how to open VSCode directly from Bash: