I would like to be able to access some frequently used directories no matter where I am in the directory path. I know aliasing can help with this problem, so I've made a few that I've placed into.bashrc. Here are some examples:
alias 'Programming'="cd /mnt/e/Programming/"
alias 'InternetExplorer' = "cd /mnt/c/Internet Explorer/"
The first alias works, but the second does not.
Here are the following things that I've tried:
alias 'InternetExplorer'="cd '/mnt/c/Internet Explorer/'"
alias 'InternetExplorer'="cd "/mnt/c/Internet Explorer/""
alias 'InternetExplorer'="cd /mnt/c/'Internet Explorer'/"
alias 'InternetExplorer'="cd /mnt/c/"Internet Explorer"/"
alias 'InternetExplorer'="cd /mnt/c/Internet\ Explorer/"
Some of these solutions do work on the command line, but I'm guessing aliasing just reads in everything under quotations as string. Also, I can always write a function called "Internet Explorer", but conceptually, I feel like alias ing should be the solution. I appreciate any help.
When in doubt, use a function instead:
InternetExplorer() { cd "/mnt/c/Internet Explorer"; }
alias InternetExplorer="cd \"/mnt/c/Internet Explorer\""
On cygwin bash, I would use
alias InternetExplorer="cd \"$(cygpath -m '*pasted dir from File Manager*'\""
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.