nuh302:UPP1:/ora/admin#top -h -d 1 > a.txt nuh302:UPP1:/ora/admin#cat a.txt System: nuh302 Thu Jul 31 18:12:37 2014 Load averages: 0.48, 0.52, 0.42 267 processes: 234 sleeping, 33 running Cpu states: (avg) LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS 0.48 14.9% 7.9% 15.8% 61.4% 0.0% 0.0% 0.0% 0.0% Memory: 8490064K (4246936K) ...
by HSRLJYHCY - Shell - 2014-08-01 11:27:07 阅读(2018) 回复(9)
问题1:最后一行是奇数行如何显示?[code][dut@ubuntu-desktop ~/sed]$cat -n boot.ini 1 [boot loader] 2 timeout=30 3 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS 4 [operating systems] 5 multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /noexecute=optin /fastdetect[/code]运行命令[code][dut@ubuntu-desktop ~/sed]$sed -n -e 'N;P' boot.ini [boot...
文件1.txt内容 WaveLength: 850nm, Transmission Distance: 550m Loopback:none, full-duplex mode, negotiation: disable, Pause Flowcontrol:Receive Enable and Send Enable Last physical up time : 2009-08-28 02:02:58 Last physical down time : 2009-08-28 01:52:13 GigabitEthernet3/0/5 current state : UP Line protocol current state : DOWN Description:To-N1G Route Port,The Maximum Transmit Unit is 1500 Inte...
:arrow:这边高人多, 我把linuxforum上的一个问题转来了,看有没有人能回答, 在那边放了几天都没人回答,郁闷:(! ----------------------------------------------------------------------- :!:我想将ls -l列表的最后一列高亮显示, 如下代码为何不行呢。(我知道用ls -l --color可以实现,但我只是想知道这样为何不行) ----------------------------------------------------------------------- #!/bin/bash ABC=`ls -l | se...
我现在有一篇英文文章,有些单词的末尾有单引号,我想将这个单引号除去,但是又要保留在单词中间的单引号。 打个比方: 有句话是 abc' def'gh sfsjd' sdfi'sdfi sfs 我想将其处理成: abc def'gh sfsjd sdfi'sdfi sfs 请问,我该如何使用sed呢?
本帖最后由 xwtnt236 于 2013-05-07 17:44 编辑
假如某文本内容为:
1.XXXXXXXX
2.XXXX
3.XXXX
....
6.
1.txt中有内容: aaa bbbbb, cccc, eeee,eee ddddddddd 如果只有sed,去掉“,”结尾的行(中间不要留空白) 得到: aaa eeee,eee ddddddddd