How to make an “alias” for a long path?

前端 未结 10 1930
广开言路
广开言路 2020-12-22 17:58

I tried to make an \"alias\" for a path that I use often while shell scripting. I tried something, but it failed:

myFold=\"~/Files/Scripts/Main\"
cd myFold
         


        
10条回答
  •  失恋的感觉
    2020-12-22 18:32

    but an actual alias for a dir is also possible, try

     myScripts="~/Files/Scripts/Main"
     alias myScripts="cd $myScripts"
    

    This way you have a common naming convention (for each dir/alias pair), and if you need to copy something from the current dir to myScripts, you don't have to think about it.

    IHTH

提交回复
热议问题