alias with parameters

前端 未结 2 2116
被撕碎了的回忆
被撕碎了的回忆 2021-02-07 06:13

If there is any possibility to use the parameters in zsh aliases? Something like this:

 alias ssh_nokia=\"ssh root@\"

Usag

2条回答
  •  情歌与酒
    2021-02-07 06:25

    I would use up ~/.ssh/config to create an alias for a particular connection, like so:

    Host=anyoldname
    Hostname=[hostname or ip address]
    User=root
    

    Then you can:

    $ ssh anyoldname
    

    More info:

    $ man ssh_config
    

提交回复
热议问题