More powerful Windows command-lines
PowerShell
Other scripting
- Windows Subsystem for Linux (2016)
introduced on Windows 10 (2015).
-
Proper Linux compatible environment.
Linux binaries can run in it.
-
Real bash shell with real Linux command-line utilities.
- install:
- Windows - Search for "Turn Windows Features On Or Off" - Enable "Windows Subsystem for Linux"
- Start - Microsoft Store - search for "Linux" - install whatever Linux distribution you want, e.g. Ubuntu
- Gives command-line with Linux commands.
- Linux files are under root dir /
- Home directory: /home/userid
Linux and Windows files
- Can we modify Windows files with Linux tools?
- Yes.
Windows files are under drive letters like: /mnt/c
- You can edit them with Linux tools, just like any normal Linux files.
- Can we modify Linux files with Windows tools?
Scripting may be slow
- A warning however.
If you use Linux scripts to process Windows files, they run slow.
-
One-off access is fine. You will not notice.
But accessing many files in a loop can run very slow.
Can be
hundreds of times slower than normal Linux.
- The problem is Linux reading Windows file system. This is inherently slow
- Comparing WSL 1 and WSL 2.
Advice is to copy/move files to Linux filesystem. Then scripts are fast.
GUI
Windows 10 running Ubuntu and Xming.
wget on command-line
gedit in GUI
Still have Windows desktop.
See
full size.
root access
- You have root access
- You can use package mangers like
apt
to update applications
- sudo apt update
- sudo apt install gedit
Windows Terminal
-
Windows Terminal
- Advanced command-line.
-
Integrates with regular cmd line, PowerShell,
and Windows Subsystem for Linux.
- See announce.