How can I ssh directly to a particular directory?

前端 未结 12 2106
情话喂你
情话喂你 2020-12-07 07:03

I often have to login to one of several servers and go to one of several directories on those machines. Currently I do something of this sort:

localhost ~]$ ssh          


        
12条回答
  •  死守一世寂寞
    2020-12-07 07:52

    I've created a tool to SSH and CD into a server consecutively – aptly named sshcd. For the example you've given, you'd simply use:

    sshcd somehost:/some/directory/somewhere/named/Foo
    

    Let me know if you have any questions or problems!

提交回复
热议问题