Re: sed a particular line in file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> % cat foo
> Hello line 1
> Hello line 2
> Hello line 3
>
> # To change just line 2
> % sed '2s/Hello/There/'
> Hello line 1
> There line 2
> Hello line 3
>
> # To change line 2 and onwards
> % sed '2,$s/Hello/There/'
> Hello line 1
> There line 2
> There line 3
>
> It's that simple :-)
>
>   

yes indeed - simples

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux