linux常用命令及技巧

continuous updating…

  1. ssh配置免密登陆

    // 指定用户
    ssh root@192.168.1.10
    // 指定端口和用户
    ssh -p 110 root@192.168.1.10

    如何配置免密登录?

  2. ssh远程执行脚本

    如何远程执行脚本?可能出现什么问题?

  3. scp远程发送文件

    scp -r /usr/local/zookeeper root@192.168.1.10:/usr/local/
  4. lsof -i查看端口情况,list open file的简写,linux中任何事物都是以文件的形式打开,包括tcp网络连接、访问nginx服务器下的资源等等

    lsof -i
    lsof -i:8080
    lsof -i | grep 8080
  5. 在脚本中获取本机IP地址

    IP=`ifconfig eth0 | grep "inet addr" | awk '{ print $2}' | awk -F: '{print $2}'`

猜你喜欢

转载自blog.csdn.net/qq_30038111/article/details/80836074