Why I can't change directories using “cd”?

后端 未结 30 2301
眼角桃花
眼角桃花 2020-11-21 06:17

I\'m trying to write a small script to change the current directory to my project directory:

#!/bin/bash
cd /home/tree/projects/java

I save

30条回答
  •  我在风中等你
    2020-11-21 06:41

    In your ~/.bash_profile file. add the next function

    move_me() {
        cd ~/path/to/dest
    }
    

    Restart terminal and you can type

    move_me 
    

    and you will be moved to the destination folder.

提交回复
热议问题