zoukankan      html  css  js  c++  java
  • Linux运维小知识

    自己日常用到的命令稍微备份一下:

    版本确认

    CentOS / RedHat Enterprise

    cat /etc/redhat-release

    Ubuntu

    cat /etc/lsb-release

    Debian

    cat /etc/debian_version

    进程查询

    ps -ef

    进程内存查询:可以检测出那些进程占用内存多且时间长

    top -u 用户名

    硬盘使用率查询:

    df -P

    显示调整:df -P | grep -Ev 'Filesystem' | sed 's/  */,/g' | awk '{print "'$HOSTNAME',""'`date +"%Y/%m/%d"`'","'`date + "%H:%M:%S"`',"$0}'

    目录文件数统计:

    find $HOME -type f -print | awk -F'/' '{i=1;temp ="";while(i < NF){temp =temp$i"/";i++} print temp}' | sort | uniq -c | awk -F' ' '{if($1>0){cmd ="date "+%Y/%m/%d %H:%M:%S"";cmd | getline var1;cmd = "hostn ame"; cmd | getline var2;print var1","var2","$2","$1}}'

    系统超大文件统计:

    find $HOME -size +102400000c

  • 相关阅读:
    AJAX 验证用户名是否存在
    字符串变量中保存路径
    hdu Kaitou Kid The Phantom Thief (2)
    hdu 连连看
    hdu Sequence one
    hdu Sticks
    hdu Nightmare
    hdu Sudoku Killer
    hdu Dota all stars
    hdu Remainder
  • 原文地址:https://www.cnblogs.com/lixiaobin/p/linuxcmd.html
Copyright © 2011-2022 走看看