Microsoft has added a new functionality that allows users of Windows Subsystem for Linux (WSL) to run Linux commands on startup in Windows 10.
Windows Insiders in the Dev channel, who wish to upgrade their Windows 10 build 21286, can now access this new feature by simply updating the Windows 10 to its latest version.
The new feature is available in the latest build of WSL in Windows 10.
Run Linux commands on start up in the Windows Subsystem for Linux (WSL)
With this new feature, the users will now be able to run various Linux binaries in ELF format. And run commands like environment configuration scripts and more, when a distro starts up.
“We have added an option that allows you to run any specified Linux command on startup of a WSL distribution,” Windows Insider Program senior program manager Brandon LeBlanc said.
“You can accomplish this by editing the /etc/wsl.conf file in your distribution and adding an option titled command under a section titled boot.”
Here is an example that shows using the new feature that is used to create a method.
This will log the time and date of their WSL distro in every start up of the Windows 10.
Once the method is created to the WSL distribution
/etc/wsl.conf file, then the Linux commands will run automatically whenever the distro starts up.
“WSL distributions will remain running for a few minutes even after the last Linux process inside of them is closed,” LeBlanc added.
“You can view if your WSL distro is running using wsl –list –verbose and you can manually shut down all WSL distributions using wsl –shutdown.”
What’s more features you can expect in the new Build 21286
The Windows 10 taskbar has introduced with news and interests:
With introduction of news and interests right on your taskbar, users can quickly get access to the personalized feeds, dynamic contents, weather updates and more. Interestingly, users can control the feeds, enable and disable them.
More control on Storage and Spaces Settings:
Windows Insiders are working on a completely new experience on how users can create, manage and store disk spaces. Within the settings app, you can now create storage pools, storage space, add/remove disks and optimize pools. Undoubtedly, this is a much needed feature for any Windows 10 users, which will give modernized storage features.
To access this feature:
- Go to Settings > System > Storage;
- Then, click the Manage Storage Spaces under “More storage settings”.
New File System Command Line Tool named DiskUsage:
With the new enhancement to the file system command line utility named DiskUsage. The new feature will enable users to quickly view and query about their disk space usage via command line argument.
Additionally, users can now be able to track their files/directories which may be consuming lots of drive space.
For example: >>
This command line will retrieve the used disk space with the current directory.
Enhanced Windows File Recovery:
Besides the above, there are various performance improvements, bug fixes and introduction of two recovery modes for the ease of file recovery.
- Regular mode – allows fast recovery option for NTFS file systems and
- Extensive mode – does a thorough search that applies to most file systems.
To check all the features, you can check out the Windows Insider Program documentation.