Tag Archive Link

Byphunsanit

WSL: Creating links shortcut

การสร้าง hard link หรือ Symbolic link ใน linux จะคล้าย ๆ การทำ shortcut ให้สามารถเข้าไปใช้ไฟล์หรือfolder ได้ง่าย ๆ เหมือน windows shortcut

การใช้ command นี้มีรูปแบบ ln source_file target_file เช่น ต้องการทำ shortcut ให้ /mnt/c/UsersDatas/var/www/prototypes_laravel/www สามารถเรียกใช้ได้จาก /var/www/prototypes_laravel/www ใน linux จะใช้คำสั่ง

sudo ln -s /mnt/c/UsersDatas/var/www/prototypes_laravel/www /var/www/prototypes_laravel/www

ทดสอบโดยใช้ คำสั่งเช่น cd /var/www/prototypes_laravel/www
ls
จะเห็นว่าสิ่งที่อยู่ด้านในจะเหมือนกับที่อยู่ใน /mnt/c/UsersDatas/var/www/prototypes_laravel/www หรือ C:\UsersDatas\var\www\prototypes_laravel\www

ดูเพิ่มเติม