For my WSL setup, in my .bashrc
, I have the following:
[ -d /mnt/c ] && alias llc='cd /mnt/c && ll'
[ -d /mnt/d ] && alias lld='cd /mnt/d && ll'
[ -d /mnt/e ] && alias lle='cd /mnt/e && ll'
This is fine to quickly jump to each Windows drive, but is it possible to make this generic such that it tries to do create aliases like these for any drive letter from c to z that it sees on startup? e.g. something like:
# this is not real code:
for i in [a-z]; do
[ -d /mnt/$(i) ] && alias ll$(i)='cd /mnt/$(i) && ll'
done