[转]linux sort,uniq,cut,wc命令详解

时间:2022-09-05 22:26:18

sort

sort 命令对 File 参数指定的文件中的行排序,并将结果写到标准输出。如果 File 参数指定多个文件,那么 sort 命令将这些文件连接起来,并当作一个文件进行排序。

sort语法

[转]linux sort,uniq,cut,wc命令详解
[root@www ~]# sort [-fbMnrtuk] [file or stdin]
选项与参数:
-f :忽略大小写的差异,例如 A 与 a 视为编码相同;
-b :忽略最前面的空格符部分;
-M :以月份的名字来排序,例如 JAN, DEC 等等的排序方法;
-n :使用『纯数字』进行排序(默认是以文字型态来排序的);
-r :反向排序;
-u :就是 uniq ,相同的数据中,仅出现一行代表;
-t :分隔符,默认是用 [tab] 键来分隔;
-k :以那个区间 (field) 来进行排序的意思
[转]linux sort,uniq,cut,wc命令详解
对/etc/passwd 的账号进行排序
[root@www ~]# cat /etc/passwd | sort
adm:x:3:4:adm:/var/adm:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin

sort 是默认以第一个数据来排序,而且默认是以字符串形式来排序,所以由字母 a 开始升序排序。

/etc/passwd 内容是以 : 来分隔的,我想以第三栏来排序,该如何

[root@www ~]# cat /etc/passwd | sort -t ':' -k 3
root:x:0:0:root:/root:/bin/bash
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
bin:x:1:1:bin:/bin:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin

默认是以字符串来排序的,如果想要使用数字排序:

cat /etc/passwd | sort -t ':' -k 3n
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh

默认是升序排序,如果要倒序排序,如下

cat /etc/passwd | sort -t ':' -k 3nr
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
ntp:x:106:113::/home/ntp:/bin/false
messagebus:x:105:109::/var/run/dbus:/bin/false
sshd:x:104:65534::/var/run/sshd:/usr/sbin/nologin

如果要对/etc/passwd,先以第六个域的第2个字符到第4个字符进行正向排序,再基于第一个域进行反向排序。

cat /etc/passwd |  sort -t':' -k 6.2,6.4 -k 1r
sync:x:4:65534:sync:/bin:/bin/sync
proxy:x:13:13:proxy:/bin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh

查看/etc/passwd有多少个shell:对/etc/passwd的第七个域进行排序,然后去重:

cat /etc/passwd |  sort -t':' -k 7 -u
root:x:0:0:root:/root:/bin/bash
syslog:x:101:102::/home/syslog:/bin/false
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
sshd:x:104:65534::/var/run/sshd:/usr/sbin/nologin

uniq

uniq命令可以去除排序过的文件中的重复行,因此uniq经常和sort合用。也就是说,为了使uniq起作用,所有的重复行必须是相邻的。

uniq语法

[root@www ~]# uniq [-icu]
选项与参数:
-i :忽略大小写字符的不同;
-c :进行计数
-u :只显示唯一的行

testfile的内容如下

[转]linux sort,uniq,cut,wc命令详解
cat testfile
hello
world
friend
hello
world
hello
[转]linux sort,uniq,cut,wc命令详解

直接删除未经排序的文件,将会发现没有任何行被删除

[转]linux sort,uniq,cut,wc命令详解
#uniq testfile
hello
world
friend
hello
world
hello
[转]linux sort,uniq,cut,wc命令详解

排序文件,默认是去重

#cat words | sort |uniq
friend
hello
world

排序之后删除了重复行,同时在行首位置输出该行重复的次数

#sort testfile | uniq -c
1 friend
3 hello
2 world

仅显示存在重复的行,并在行首显示该行重复的次数

#sort testfile | uniq -dc
3 hello
2 world

仅显示不重复的行

sort testfile | uniq -u
friend

cut

cut命令可以从一个文本文件或者文本流中提取文本列。

cut语法

[root@www ~]# cut -d'分隔字符' -f fields <==用于有特定分隔字符
[root@www ~]# cut -c 字符区间 <==用于排列整齐的信息
选项与参数:
-d :后面接分隔字符。与 -f 一起使用;
-f :依据 -d 的分隔字符将一段信息分割成为数段,用 -f 取出第几段的意思;
-c :以字符 (characters) 的单位取出固定字符区间;

PATH 变量如下

[root@www ~]# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/games
# 1 | 2 | 3 | 4 | 5 | 6 |

将 PATH 变量取出,我要找出第五个路径。

#echo $PATH | cut -d ':' -f 5
/usr/local/bin

将 PATH 变量取出,我要找出第三和第五个路径。

#echo $PATH | cut -d ':' -f 3,5
/sbin:/usr/local/bin

将 PATH 变量取出,我要找出第三到最后一个路径。

echo $PATH | cut -d ':' -f 3-
/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/games

将 PATH 变量取出,我要找出第一到第三个路径。

#echo $PATH | cut -d ':' -f 1-3
/bin:/usr/bin:/sbin:
 

将 PATH 变量取出,我要找出第一到第三,还有第五个路径。

echo $PATH | cut -d ':' -f 1-3,5
/bin:/usr/bin:/sbin:/usr/local/bin

实用例子:只显示/etc/passwd的用户和shell

#cat /etc/passwd | cut -d ':' -f 1,7
root:/bin/bash
daemon:/bin/sh
bin:/bin/sh

 wc

统计文件里面有多少单词,多少行,多少字符。

wc语法

[root@www ~]# wc [-lwm]
选项与参数:
-l :仅列出行;
-w :仅列出多少字(英文单字);
-m :多少字符;

默认使用wc统计/etc/passwd

#wc /etc/passwd
40 45 1719 /etc/passwd

40是行数,45是单词数,1719是字节数

wc的命令比较简单使用,每个参数使用如下:

[转]linux sort,uniq,cut,wc命令详解
#wc -l /etc/passwd   #统计行数,在对记录数时,很常用
40 /etc/passwd #表示系统有40个账户 #wc -w /etc/passwd #统计单词出现次数
45 /etc/passwd #wc -m /etc/passwd #统计文件的字节数
[转]linux sort,uniq,cut,wc命令详解

转:http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858385.html

根据上面一些命令做一些日志分析

提取日志里面关键参数:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABJ4AAAB9CAIAAABs7j6CAAAWw0lEQVR4nO3dT667uhnG8b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bzgrYJ4QQQlYakgiEEEIIaQdKBEIIIYQIUCIQQgghRIASgRBCCCECzUkE71VD/bd++u2LgjcZVQkIduLXIZOFlCzvABa3idJ+k4iusFsihBBCWpMI0VrG+Z62avui0am7b922Uoeb1m2odNtE6b46QLtVcS9HQgghtbQnEbYO7cTSRpnjBolQsr/+mYzMratDgnUXLHGoWBKBEEIIydOWRDi++x+delbcKhHwMgQ2+zMQHBdIBGMcFhWxZy1YBkI6TgghhJRpTSJ46/3cIhH8P5UdObQzDf0VQ3fxfFMcgvWUvGcL6DghhBBSpi2J4I2Zp6E3vE9Y0VWre3K8nbTs3gUSwRiHdDHp5Rc6TgghhJRpSiKEnWV+p0Z0Vfm47u/SifilhvMSwRqH6IxdCqDjhBBCSJmmJEIwF66eGK+SCLF14/ZIcAoBpWuyn4kDsOPNFwS6AB0nhBBCSjQlEeZwyYGCPqjZvgg+4rdt4yR+ZZDdNsm6TRSKA5QanjWUCl9EIIQQYqA1iUAIIYSQJqBEIIQQQogAJQIhhBBCBLrgkXgLr7M95o96+cbbaHvxw3J8riqqa+zEL3ZsVLtFCCEf5w9P/dPwpVWGbwAAAABJRU5ErkJggg==" alt="" />

[转]linux sort,uniq,cut,wc命令详解的更多相关文章

  1. linux sort&comma;uniq&comma;cut&comma;wc命令详解

    linux sort,uniq,cut,wc命令详解 sort sort 命令对 File 参数指定的文件中的行排序,并将结果写到标准输出.如果 File 参数指定多个文件,那么 sort 命令将这些 ...

  2. (转)linux sort&comma;uniq&comma;cut&comma;wc命令详解

    linux sort,uniq,cut,wc命令详解 sort sort 命令对 File 参数指定的文件中的行排序,并将结果写到标准输出.如果 File 参数指定多个文件,那么 sort 命令将这些 ...

  3. linux sort&comma;uniq&comma;cut&comma;wc命令详解 (转)

    sort sort 命令对 File 参数指定的文件中的行排序,并将结果写到标准输出.如果 File 参数指定多个文件,那么 sort 命令将这些文件连接起来,并当作一个文件进行排序. sort语法 ...

  4. &lpar;F&rpar; linux sort&comma;uniq&comma;cut&comma;wc命令详解

    F:http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858385.html sort sort 命令对 File 参数指定的文件中的行排序,并 ...

  5. Linux之 sort&comma;uniq&comma;cut&comma;wc命令详解

    sort sort 命令对 File 参数指定的文件中的行排序,并将结果写到标准输出.如果 File 参数指定多个文件,那么 sort 命令将这些文件连接起来,并当作一个文件进行排序. sort语法 ...

  6. Ubuntu 14&period;10 下sort&comma;uniq&comma;cut&comma;wc命令详解

    sort sort 命令对 File 参数指定的文件中的行排序,并将结果写到标准输出.如果 File 参数指定多个文件,那么 sort 命令将这些文件连接起来,并当作一个文件进行排序. sort语法 ...

  7. sort&comma;uniq&comma;cut&comma;wc命令详解

    sortsort 命令对 File 参数指定的文件中的行排序,并将结果写到标准输出.如果 File 参数指定多个文件,那么 sort 命令将这些文件连接起来,并当作一个文件进行排序. sort语法 s ...

  8. uniq cut wc 命令详解

    uniq uniq命令可以去除排序过的文件中的重复行,因此uniq经常和sort合用.也就是说,为了使uniq起作用,所有的重复行必须是相邻的. uniq语法 [root@www ~]# uniq [ ...

  9. 【转帖】linux sort&comma;uniq&comma;cut&comma;wc&comma;tr&comma;xargs命令详解

    linux sort,uniq,cut,wc,tr,xargs命令详解 http://embeddedlinux.org.cn/emb-linux/entry-level/201607/21-5550 ...

随机推荐

  1. 读书笔记--SQL必知必会08--使用函数处理数据

    8.1 函数 每个DBMS都有特定的函数.事实上,只有少数的几个函数被所有主要DBMS同时支持. 实现同一功能的函数,在不同的DBMS中的名称和语法极有可能不同,也就是说SQL函数不可移植的. 可移植 ...

  2. ubuntu15&period;10安装搜狗拼音输入法

    sudo vim /etc/apt/sources.list.d/ubuntukylin.list(我的默认显示没有这个文件将自动创建) 添加源deb http://archive.ubuntukyl ...

  3. 【LeetCode OJ】Symmetric Tree

    Problem Link: https://oj.leetcode.com/problems/symmetric-tree/ To solve the problem, we can traverse ...

  4. ZYNQ学习之——MIO

    1.GPIO基础知识 Zynq7000 系列芯片有 54 个 MIO(multiuse I/O) ,它们分配在 GPIO 的 Bank0 和Bank1 隶属于 PS 部分, 这些 IO 与 PS 直接 ...

  5. 一个比较轻巧好用的js分页插件,可ajax可url

    var pageNav = pageNav || {}; pageNav.fn = null; pageNav.pre = "pre"; pageNav.next = " ...

  6. 【HDOJ】4400 Mines

    (1) KD树,但实际没有STL快,3000+ /* 4400 */ #include <iostream> #include <string> #include <ma ...

  7. 在uboot上创建菜单

    一.原理 菜单其实就是一个uboot中的命令,和其他的命令没有什么差别.  uboot启动时,如果进入uboot命令模式,先运行这个命令,就会打印出一个菜单界面. 在uboot的命令模式,通过键入“m ...

  8. clearInterval&lpar;&rpar;与setInterval&lpar;&rpar;的应用

    1.setInterval()按照一定的周期调用函数2.clearInterval()取消setInterval()的周期调用 例如:图片轮播中的clearInterval()与setInterval ...

  9. 一个ASP&period;NET Web API 2&period;0应用

    在一个空ASP.NET Web项目上创建一个ASP.NET Web API 2.0应用 由于ASP.NET Web API具有与ASP.NET MVC类似的编程方式,再加上目前市面上专门介绍ASP.N ...

  10. Picasso解决 TextView加载html图片异步显示

    项目中有这样一个需求: textview加载一段 html标签 其中包含 "<Img url= " 图片异步展示 而且 根据图片的比例 宽度满屏展示. 思路: 重写textv ...