You can use WSL to execute many Linux commands in Windows 10. Whether it is a Linux-based system or macOS, many of their system management tasks are done inside the terminal. However, Windows 10 lacks such functionality. Do you want to run a cron task? No. Do you want to SSH into your server and then rsync files? no way. How to manage local files with powerful command line tools instead of using slow and unreliable GUI tools?
In this tutorial, you'll see how to use WSL to perform tasks other than administration—such as mounting USB drives and manipulating files. You need to run a fully updated Windows 10 and choose a Linux distribution. I covered these steps in the previous article, so if you keep up with the progress, start from there. let's start.
Keep your Linux system updatedIn fact, when you run Ubuntu or openSUSE through WSL, the underlying Linux kernel is not running. However, you must keep a full update of your distribution to protect your system from any new known vulnerabilities. Since there are only two free community distributions in the Windows Store, the tutorial will only cover the following two: openSUSE and Ubuntu.
Update your Ubuntu system:
# sudo apt-get update
# sudo apt-get dist-upgrade
Run the update for openSUSE:
# zypper up
You can also upgrade openSUSE to the latest version using the dup command. However, before running the system upgrade, use the previous command to run the update.
# zypper dup
Note: openSUSE defaults to root. If you want to perform any non-administrator tasks, switch to a non-privileged user. You can learn how to create users on openSUSE in this article.
Manage local filesIf you want to use a good Linux command line tool to manage local files, you can do this easily with WSL. Unfortunately, WSL does not yet support things like lsblk or mount to mount local drives. However, you can cd to the C drive and manage the files:
/mnt/c/Users/swapnil/Music
I am now in the Music directory of the C drive.
To install additional drives, partitions, and external USB drives, you need to create a mount point and mount the drive.
Open File Explorer and check the mount point for the drive. Suppose it is mounted as S:\ in Windows.
In the Ubuntu/openSUSE terminal, create a mount point for the drive.
Sudo mkdir /mnt/s
Mount the drive now:
Mount -f drvfs S: /mnt/s
Once the mount is complete, you can now access the drive from the distribution. Keep in mind that distributions that run in WSL mode will see what Windows can see. Therefore, you cannot mount an ext4 drive that cannot be mounted natively on Windows.
Now you can use all these magical Linux commands here. Want to copy or move files from one folder to another? Just run the cp or mv command.
Cp /source-folder/source-file.txt /desTInaTIon-folder/
Cp /music/classical/Beethoven/symphony-2.mp3 /plex-media/music/classical/
If you want to move folders or large files, I would recommend rsync instead of the cp command:
Rsync -avzP /music/classical/Beethoven/symphonies/ /plex-media/music/classical/
To create a new directory on your Windows drive, just use the mkdir command.
Want to set up a cron job at a time to automate tasks? Continue to create a cron job using crontab -e. Very simple.
You can also mount network/remote folders in Linux so that you can manage them with better tools. All my drives are plugged into the Raspberry Pi or server, so I just need to ssh into the machine and manage the hard drive. Transferring files between the local computer and the remote system can be done again using the rsync command.
WSL is no longer a beta, it will continue to get more new features. Two of the features I am excited about are the lsblk command and the dd command, which allow me to manage my drive natively on Windows and create a bootable Linux drive. If you are new to the Linux command line, the previous tutorial will help you get started with some of the most basic commands.
ZGAR Accessories
ZGAR electronic cigarette uses high-tech R&D, food grade disposable pod device and high-quality raw material. All package designs are Original IP. Our designer team is from Hong Kong. We have very high requirements for product quality, flavors taste and packaging design. The E-liquid is imported, materials are food grade, and assembly plant is medical-grade dust-free workshops.
Our products include disposable e-cigarettes, rechargeable e-cigarettes, rechargreable disposable vape pen, and various of flavors of cigarette cartridges. From 600puffs to 5000puffs, ZGAR bar Disposable offer high-tech R&D, E-cigarette improves battery capacity, We offer various of flavors and support customization. And printing designs can be customized. We have our own professional team and competitive quotations for any OEM or ODM works.
We supply OEM rechargeable disposable vape pen,OEM disposable electronic cigarette,ODM disposable vape pen,ODM disposable electronic cigarette,OEM/ODM vape pen e-cigarette,OEM/ODM atomizer device.
ZGAR Accessories Disposable Pod Vape,ZGAR Accessories Disposable Vape Pen,ZGAR Accessories,ZGAR Accessories Electronic Cigarette,ZGAR Accessories OEM vape pen,ZGAR Accessories OEM electronic cigarette.
ZGAR INTERNATIONAL(HK)CO., LIMITED , https://www.zgarette.com