Set the default directory in mac terminal

后端 未结 6 1912
天命终不由人
天命终不由人 2020-12-23 09:00

I only use terminal (mac) for git, and I only use git for one directory. Is it possible to set the default directory (the directory when terminal is opened) to the directory

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-23 09:51

    If you are using for example ZSH, just add to your config file .zshrc this string:

    # Working directory
    cd ~/Desktop
    

    or for instance:

    # Working directory
    cd $HOME/Desktop
    

    Change path with your preference.

    It just will return command to ZSH, you won't see it in terminal and it will start with your chosen path.

提交回复
热议问题