Make it started when you start your Windows

wsl-ubuntun.vbs - 开机自启

1
2
Set ws = CreateObject("Wscript.Shell")
ws.run "C:\Users\guo\AppData\Local\Microsoft\WindowsApps\ubuntu1804.exe run sudo /etc/init.wsl", vbhide

/etc/init.wsl

1
2
3
4
#! /bin/sh
/etc/init.d/ssh restart
/etc/init.d/mysql restart
/etc/init.d/cron restart
1
2
3
4
5
6
7
sudo chmod a+w "R"

# 递归查找视频文件并移动,指定遍历最小深度为 2, 当前目录忽略
find . -mindepth 2 -type f | grep -ZP "\.(MP4|mkv|mov|mp4|wmv)$" | awk '{ printf $0"\0" }' | xargs -I R -0 -n 1 sudo mv "R" video/

# 递归查找图片文件并移动,指定遍历最小深度为 2, 当前目录忽略
find . -mindepth 2 -type f | grep -P "\.(JPG|jpg|png|jpeg|gif|raw)$" | awk '{ printf $0"\0" }' | xargs -I R -0 -n 1 sudo mv "R" ./picture