zoukankan      html  css  js  c++  java
  • 工作中常用到的Linux命令

    ps: (ps的参数分成basic, list, output, thread, miscellaneous)

    (basic) -e / -A 显示所有进程

    (output) -o 输出指定字段 

    ls:

    最常见的ll = ls -al就不说了:

    -X 根据扩展名排序

    -t 以文件修改时间排序

    -S 根据文件大小排序

    -r 依相反次序排列(默认是按照文件名排序的)

    -d 将文件夹像文件一样显示,而不是显示其下的文件

    -h 以人类看得懂的方式显示文件大小

    ll | grep ^d 只显示文件夹

    ll | grep ^- 只显示文件

    grep:

    -i 忽略大小写

    -c 计算符合要求的行数

    -v 取结果的补集

    grep '\' 或者 grep "\\" 查找反斜杠(单双引号的区别)

    -E 支持正则表达式,如"^$|#"

    -o 只显示匹配正则表达式的字符串

    mount:

    mount.cifs -o domain=corp.contoso.com,username=admin //10.27.31.132/share/ /mnt/techsupport/  或

    mount -t cifs -o domain=corp.contoso.com,username=admin //10.27.31.132/share/ /mnt/techsupport/

    ( 如果不装cifs-utils则没有mount.cifs这条命令,而且会提示:

    mount: //10.27.31.132/share/ is write-protected, mounting read-only
    mount: cannot mount //10.27.31.132/share/ read-only )

    df:

    df -h 获得各文件系统的大小情况

    du:

    du -h --max-depth=1 ./ 获取当前目录下各个子目录的大小

    du -sh ./ 获取当前目录的总大小

  • 相关阅读:
    MapReduce案例WordCount
    MapReduce排序案例
    MapReduce倒排索引
    MapReduce自定义排序编程
    GroupingComparator 自定义分组
    CombineTextInputFormat小文件处理场景
    cdh 2.6.0版本和apache 2.7.x版本 本地执行环境的差异。
    DistributedCache 分布式缓存
    MapReduce数据压缩机制
    MapReduce其他功能
  • 原文地址:https://www.cnblogs.com/IvanChen/p/6991803.html
Copyright © 2011-2022 走看看