码迷,mamicode.com
首页 > 系统相关 > 详细

shell_action

时间:2017-03-25 17:39:15      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:tran   size   first   ever   compare   数值   word   临时文件   disk   

 

zebra@ubuntu:~$ sort --help
用法:sort [选项]... [文件]...
 或:sort [选项]... --files0-from=F
Write sorted concatenation of all FILE(s) to standard output.

必选参数对长短选项同时适用。
排序选项:

  -b, --ignore-leading-blanks   忽略前导的空白区域
  -d, --dictionary-order        只考虑空白区域和字母字符
  -f, --ignore-case             忽略字母大小写
  -g, --general-numeric-sort  compare according to general numerical value
  -i, --ignore-nonprinting    consider only printable characters
  -M, --month-sort            compare (unknown) < JAN < ... < DEC
  -h, --human-numeric-sort    使用易读性数字(例如: 2K 1G)
  -n, --numeric-sort            根据字符串数值比较
  -R, --random-sort             根据随机hash 排序
      --random-source=文件      从指定文件中获得随机字节
  -r, --reverse                 逆序输出排序结果
      --sort=WORD               按照WORD 指定的格式排序:
                                        一般数字-g,高可读性-h,月份-M,数字-n,
                                        随机-R,版本-V
  -V, --version-sort            在文本内进行自然版本排序

其他选项:

      --batch-size=NMERGE       一次最多合并NMERGE 个输入;如果输入更多
                                        则使用临时文件
  -c, --check, --check=diagnose-first   检查输入是否已排序,若已有序则不进行操作
  -C, --check=quiet, --check=silent     类似-c,但不报告第一个无序行
      --compress-program=程序   使用指定程序压缩临时文件;使用该程序
                                        的-d 参数解压缩文件
      --debug                   为用于排序的行添加注释,并将有可能有问题的
                                        用法输出到标准错误输出
      --files0-from=文件        从指定文件读取以NUL 终止的名称,如果该文件被
                                        指定为"-"则从标准输入读文件名
  -k, --key=KEYDEF          sort via a key; KEYDEF gives location and type
  -m, --merge               merge already sorted files; do not sort
  -o, --output=文件             将结果写入到文件而非标准输出
  -s, --stable                  禁用last-resort 比较以稳定比较算法
  -S, --buffer-size=大小        指定主内存缓存大小
  -t, --field-separator=分隔符  使用指定的分隔符代替非空格到空格的转换
  -T, --temporary-directory=目录        使用指定目录而非$TMPDIR 或/tmp 作为
                                        临时目录,可用多个选项指定多个目录
      --parallel=N              将同时运行的排序数改变为N
  -u, --unique          配合-c,严格校验排序;不配合-c,则只输出一次排序结果
  -z, --zero-terminated 以0 字节而非新行作为行尾标志
      --help            显示此帮助信息并退出
      --version         显示版本信息并退出

KEYDEF is F[.C][OPTS][,F[.C][OPTS]] for start and stop position, where F is a
field number and C a character position in the field; both are origin 1, and
the stop position defaults to the lines end.  If neither -t nor -b is in
effect, characters in a field are counted from the beginning of the preceding
whitespace.  OPTS is one or more single-letter ordering options [bdfgiMhnRrV],
which override global ordering options for that key.  If no key is given, use
the entire line as the key.

SIZE may be followed by the following multiplicative suffixes:
内存使用率% 1%,b 1、K 1024 (默认),M、G、T、P、E、Z、Y 等依此类推。

如果不指定文件,或者文件为"-",则从标准输入读取数据。

*** 警告 ***
本地环境变量会影响排序结果。
如果希望以字节的自然值获得最传统的排序结果,请设置LC_ALL=C。

请向bug-coreutils@gnu.org 报告sort 的错误
GNU coreutils 的主页:<http://www.gnu.org/software/coreutils/>
GNU 软件一般性帮助:<http://www.gnu.org/gethelp/>
请向<http://translationproject.org/team/zh_CN.html> 报告sort 的翻译错误
要获取完整文档,请运行:info coreutils sort invocation
zebra@ubuntu:~$

 

技术分享

 

zebra@ubuntu:~$ sudo du  --help
用法:du [选项]... [文件]...
 或:du [选项]... --files0-from=F
Summarize disk usage of each FILE, recursively for directories.

必选参数对长短选项同时适用。
  -0, --null            end each output line with 0 byte rather than newline
  -a, --all             write counts for all files, not just directories
      --apparent-size   print apparent sizes, rather than disk usage; although
                          the apparent size is usually smaller, it may be
                          larger due to holes in (sparse) files, internal
                          fragmentation, indirect blocks, and the like
  -B, --block-size=SIZE  scale sizes by SIZE before printing them.  E.g.,
                           -BM prints sizes in units of 1,048,576 bytes.
                           See SIZE format below.
  -b, --bytes           equivalent to --apparent-size --block-size=1
  -c, --total           produce a grand total
  -D, --dereference-args  dereference only symlinks that are listed on the
                          command line
  -d, --max-depth=N     print the total for a directory (or file, with --all)
                          only if it is N or fewer levels below the command
                          line argument;  --max-depth=0 is the same as
                          --summarize
      --files0-from=F   summarize disk usage of the NUL-terminated file
                          names specified in file F;
                          If F is - then read names from standard input
  -H                    equivalent to --dereference-args (-D)
  -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)
  -k                    like --block-size=1K
  -L, --dereference     dereference all symbolic links
  -l, --count-links     count sizes many times if hard linked
  -m                    like --block-size=1M
  -P, --no-dereference  dont follow any symbolic links (this is the default)
  -S, --separate-dirs   do not include size of subdirectories
      --si              like -h, but use powers of 1000 not 1024
  -s, --summarize       display only a total for each argument
  -t, --threshold=SIZE  exclude entries smaller than SIZE if positive,
                          or entries greater than SIZE if negative
      --time            show time of the last modification of any file in the
                          directory, or any of its subdirectories
      --time=WORD       show time as WORD instead of modification time:
                          atime, access, use, ctime or status
      --time-style=STYLE  show times using style STYLE:
                          full-iso, long-iso, iso, +FORMAT
                          FORMAT is interpreted like date
  -X, --exclude-from=FILE  exclude files that match any pattern in FILE
      --exclude=PATTERN    exclude files that match PATTERN
  -x, --one-file-system    skip directories on different file systems
      --help            显示此帮助信息并退出
      --version         显示版本信息并退出

所显示的数值是来自 --block-size、DU_BLOCK_SIZE、BLOCK_SIZE
及 BLOCKSIZE 环境变量中第一个可用的 SIZE 单位。
否则,默认单位是 1024 字节(或是 512,若设定 POSIXLY_CORRECT 的话)。

SIZE is an integer and optional unit (example: 10M is 10*1024*1024).  Units
are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (powers of 1000).

请向bug-coreutils@gnu.org 报告du 的错误
GNU coreutils 的主页:<http://www.gnu.org/software/coreutils/>
GNU 软件一般性帮助:<http://www.gnu.org/gethelp/>
请向<http://translationproject.org/team/zh_CN.html> 报告du 的翻译错误
要获取完整文档,请运行:info coreutils du invocation

 

sudo du -h --max-depth=2 /var/tmp/

sudo du -h --max-depth=2 /var/tmp/*

技术分享

CRTL+c

退出“错误命令”

技术分享

shell_action

标签:tran   size   first   ever   compare   数值   word   临时文件   disk   

原文地址:http://www.cnblogs.com/yuanjiangw/p/6617641.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!