File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ sed��һ���ܺõ��ļ��������ߣ�������һ���ܵ������Ҫ������Ϊ��λ���д��������Խ������н����滻��ɾ����������ѡȡ���ض��������������˽�һ��sed���÷�
2
+ sed�����и�ʽΪ��
3
+ sed [-nefri] ��command�� �����ı�
4
+
5
+ ����ѡ�
6
+ -n��ʹ�ð���(silent)ģʽ����һ�� sed ���÷��У��������� STDIN������һ�㶼�ᱻ�г���өĻ�ϡ���������� -n ��������ֻ�о���sed ���������һ��(���߶���)�Żᱻ�г�����
7
+ -e��ֱ����ָ����ģʽ�Ͻ��� sed �Ķ����༭��
8
+ -f��ֱ�ӽ� sed �Ķ���д��һ�������ڣ� -f filename �����ִ�� filename �ڵ�sed ������
9
+ -r��sed �Ķ���֧Ԯ���������������ʾ�������(Ԥ���ǻ��������ʾ���)
10
+ -i��ֱ���Ķ�ȡ�ĵ������ݣ���������өĻ�����
11
+
12
+ �������
13
+ a �������� a �ĺ�����Խ��ִ�������Щ�ִ������µ�һ�г���(Ŀǰ����һ��)��
14
+ c ��ȡ���� c �ĺ�����Խ��ִ�����Щ�ִ�����ȡ�� n1,n2 ֮����У�
15
+ d ��ɾ������Ϊ��ɾ���������� d ����ͨ�������κ����ˣ�
16
+ i �ò��룬 i �ĺ�����Խ��ִ�������Щ�ִ������µ�һ�г���(Ŀǰ����һ��)��
17
+ p ����ӡ���༴��ij��ѡ�������ӡ����ͨ�� p ������� sed -n һ��������
18
+ s ��ȡ��������ֱ�ӽ���ȡ���Ĺ�������ͨ����� s �Ķ������Դ��������ʾ����
19
+
20
+
21
+ ɾ��ƥ����
22
+
23
+ sed -i '/ƥ���ַ���/d' filename ��ע����ƥ���ַ����DZ���������Ҫ�����������ǡ������ǵú����ǣ�
24
+
25
+ �滻ƥ�����е�ij���ַ���
26
+
27
+ sed -i '/ƥ���ַ���/s/�滻Դ�ַ���/�滻Ŀ���ַ���/g' filename
You can’t perform that action at this time.
0 commit comments