ChinaUnix.net
相关文章推荐:

uniq使用

有这样格式的数据: session_id (tab) url_in (tab) url_out 先对文件sort -n aaa.txt |uniq -c 产生: cnt (tab) session_id (tab) url_in (tab) url_out 我想得到一些数据统计: (1) 所有行cnt求和 (2) 所有行session_id进行sort|uniq后求和 (3) 以url_in和url_out为group,cnt求和,session_id进行sort|uniq后求和 本来这些操作使用mysql数据库来做的,可是现在数据过于庞大,只好用脚本了,可是我对脚本不很熟悉,自己最近也看了不少...

by dinner3000 - Shell - 2005-04-28 23:10:33 阅读(3019) 回复(2)

相关讨论

好像我试验过 -f 不行啊,那位大哥指导以下, 用uniq 如何只对特定列进行处理

by wpeng18 - Shell - 2007-09-05 11:01:39 阅读(1842) 回复(3)

score SARE_OBFUSEXUAL 3.333 # type=obfu score SARE_OBFUTEENS 2.500 # type=obfu score SARE_OBFUTESTO 2.500 # type=obfu score SARE_OBFUVRGN 2.500 # type=obfu score SARE_OBFUVRGN 3.500 # type=obfu score SARE_OBFUVRGN 1.500 # type=obfu score SARE_PLEASEPARTNR 1.226 score SARE_PNSPTCH 1.5 # was .33 score SARE_PNSPTCH 2.3 # was .333 score SARE_PNSPTCH 1.5 # was .333 score ...

by snowtty - Shell - 2006-08-04 16:36:11 阅读(1258) 回复(4)

为了检查我的服务器上已建立的连接IP,使用下面命令 $ netstat | grep 'ESTABLISHED' | awk '{print $5}' | awk -F: '{print $1}' | uniq -c | sort -0n 为什么仍然还有许多重复的IP?难道uniq -c没有起作用? 而,如果我在uniq -c 前面再加一个sort $ netstat | grep 'ESTABLISHED' | awk '{print $5}' | awk -F: '{print $1}' | sort |uniq -c | sort -0n 就不会出现重复的IP了,这是为什么啊? 请高手指点 谢谢啊

by xxjoyjn - Shell - 2006-04-23 21:02:50 阅读(1243) 回复(2)

tr 把第一组字符转化为第二组字符 tr -s 压缩输出的空格 sort 每个单词被使用的次数对文件进行排序 sort -rn排序数字 sort -k 对不同列数字进行排序 uniq 重复的行只保留一行 uniq -c 对字符出现的次数进行排序

by 午夜聆听 - Shell - 2004-06-28 12:45:45 阅读(1032) 回复(1)

flow.pl 的代码: ... $| = 1; open(STDOUT, "| uniq") || die "Can't open pipe for uniq!"; if ($ARGV[0]) { #if a file is specified on the command line, use it instead of STDIN open(STDIN, "<$ARGV[0]") || die "Can't open file $ARGV[0]\n"; } ... flow.pl从另外一个程序a获得持续性输入, 程序a必须用Ctrl+c终止。 命令行: a |?flow.pl | tee xxx 由于uniq需要读到EOF才能输出,我想在flow.pl收到INT信号时产生...

by zelotchx - Perl - 2008-08-28 17:18:38 阅读(1647) 回复(0)

图中红色字部分是用cat -e "\e[31m红字\e[0m" >> myfiles 这样实现的, 直接uniq myfiles就不能把重复的红字的行删掉 sort后就可以了,这是怎么回事,

by ahlai - Shell - 2007-02-09 09:40:40 阅读(1071) 回复(1)

RT,先谢了。:mrgreen:

by ILoveMK - Shell - 2010-12-19 16:04:58 阅读(3594) 回复(7)

在tcsh下运行: >flow.pl | uniq | tee log flow.pl 不断产生输出,uniq删除重复行然后保存到“log”,同时在stdout输出 问题是 uniq | tee 会将输出缓存,怎么才能即时输出呢

by zelotchx - Shell - 2008-08-29 09:55:01 阅读(3025) 回复(14)

uniq -c的时候会出现如下情况: 20 abc 9 dc 请问如何才能设定分隔符,比如: 20:abc 9:dc 多谢.

by zhao_yi707 - Shell - 2006-10-13 13:33:55 阅读(1000) 回复(1)

setoo package # uniq -c list 1 basesystem 1 bash 1 coreutils 1 cpio 1 e2fsprogs 1 ed 1 file 1 filesystem 1 glibc 1 grub 1 hdparm 1 hotplug 1 initscripts 1 iproute 1 iputils 1 kbd 1 kernel 1 passwd 1 procps 1 readline 1 rootfiles 1 rpm 1 sysklogd 1 SysVinit...

by Yuri.G. - Shell - 2006-08-28 18:58:38 阅读(1293) 回复(6)