How to make SSH go directly to specific directory?

后端 未结 3 1911
孤城傲影
孤城傲影 2021-02-07 03:02

when you do an \"ssh second_machine\" you are able to connect to second_machine on your home directory

But usually i am working in my_machine in directory with very long

3条回答
  •  北海茫月
    2021-02-07 03:56

    You could do something like the one I'm using. Make an alias as the one below.

    alias ssh 'ssh -t \!* "cd $PWD; csh"'
    

    (here, csh could also be replaced by bash)

    This brings you directly to the 'current' path on the other machine. The usage would be like [$] ssh some machine However, I find that it works slow. So, I'm looking for an alternative.

提交回复
热议问题