zoukankan      html  css  js  c++  java
  • Linux环境常用命令

    bash

    host                    #查看IP对应机器名

    hostname         #查看本机名         hostname –i     #查看本机IP

    mssh --host-list '10.4.20.87,10.4.20.88,10.4.20.92,10.4.20.93' --host-timeout 200 'cd .service; svc -h suggestion_new_service_run; sleep 120'

    netstat –nlpt   #查看网络端口

    nmap -p 7021 10.42.117.16    #扫描网络端口

    ps aux                #查看进程,进程memory使用

    top -c                   #查看CPU、Memory使用率,可配合grep使用(top -c |grep xxx)

    diff –rau dir1 dir2     #对比两个目录的差异

    du –sh --max-depth=1 .             #查看占用文件系统存储

    df –h                  #查看文件系统配额

    lsof                    #查看目录下打开的文件

    zip (-r) cat.zip cat     #zip压缩文件或目录     unzip         #解压zip文件

    tar zcvf cat.tar.gz cat/     #tar.gz压缩文件或目录

    tar zxvf cat.tar.gz             #tar.gz解压文件或目录

    iconv -c -f utf8 -t gb18030    #转码

    join -a 1 -a 2 -t$' ' -1 2 -2 2 -o '1.1,0,1.3,2.1' -e'0' a.txt b.txt

    #全连接(-a 1 -a 2)a.txt和b.txt两个文件的第2列(-1 2 -2 2),使用' '分隔,缺失位补'0',显示格式是:(file1列1,匹配列,file1列3,file2列1)('1.1,0,1.3,2.1')

    https://linux.die.net/man/1/join

    screen

    screen -S s1

    screen -ls

    screen -r s1

    screen -d

    ctrl-a + c

    ctrl-a + 0..9

    ctrl-a + p    ctrl-a + n

    ctrl-a + d

    ctrl-a + k

    更全面的:

    命令行的艺术 (GitHub 星标 6 万多)

    https://mp.weixin.qq.com/s/qN_qC9m2JoAAnMScukDUUw

  • 相关阅读:
    HashMap源码解析
    深入理解Java字符串
    Netty粘包、半包
    Netty源码分析-Future和Promise
    Lock简介
    一、Netty中的EventLoop
    对象实例化内存布局与访问定位
    运行时数据区概述及线程
    TCP三次握手和四次挥手
    Redis线程IO模型-Redis 单线程为什么还能这么快?
  • 原文地址:https://www.cnblogs.com/yaoyaohust/p/10363186.html
Copyright © 2011-2022 走看看