How can I ssh directly to a particular directory?

前端 未结 12 2104
情话喂你
情话喂你 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:38

    Another way of going to directly after logging in is create "Alias". When you login into your system just type that alias and you will be in that directory.

    Example : Alias = myfolder '/var/www/Folder'

    After you log in to your system type that alias (this works from any part of the system)
    this command if not in bashrc will work for current session. So you can also add this alias to bashrc to use that in future

    $ myfolder => takes you to that folder

提交回复
热议问题