美文网首页
linux命令笔记

linux命令笔记

作者: 任无名F | 来源:发表于2017-08-21 22:14 被阅读0次
    1. 查看服务器最后重启时间
    // 方法一
    #last reboot
    // 方法二
    #who -b
    // 方法三
    #uptime
    
    2. 根据文件名查找文件
    #find [path] -name [filename]
    
    3. 查看进程信息
    #ps aux | grep [name]
    #ps -ef | grep [name] // 与上一条的区别,会显示PPID(父进程ID)
    
    4. 使用scp复制本地文件到远程服务器
    scp [-P port] [[user@]host1:]file1 ... [[user@]host2:]/path/
    

    Tips

    • 一定确保本地和远程服务器都安装了openssh-clients,否则会报错
    -bash: scp: command not found
    
    • 安装openssh-clients
    yum install openssh-clients
    
    • [[user@]host:]可以使用 服务器别名 代替:
    # .ssh/config中配置服务器别名
    Host ren
    HostName 1.2.3.4
    Port 8080
    User root
    

    在scp中使用服务器别名

    scp ./file1 ren:/path/
    

    相关文章

      网友评论

          本文标题:linux命令笔记

          本文链接:https://www.haomeiwen.com/subject/qomzrxtx.html