<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sed &#8211; 良的世界</title>
	<atom:link href="https://www.lemonary.cn/tag/sed/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lemonary.cn</link>
	<description></description>
	<lastBuildDate>Mon, 16 Dec 2024 02:07:01 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.lemonary.cn/wp-content/uploads/2024/12/logo-150x150.jpg</url>
	<title>sed &#8211; 良的世界</title>
	<link>https://www.lemonary.cn</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Linux三剑客之巧用sed转换MAC地址</title>
		<link>https://www.lemonary.cn/linux%e4%b8%89%e5%89%91%e5%ae%a2%e4%b9%8b%e5%b7%a7%e7%94%a8sed%e8%bd%ac%e6%8d%a2mac%e5%9c%b0%e5%9d%80/</link>
					<comments>https://www.lemonary.cn/linux%e4%b8%89%e5%89%91%e5%ae%a2%e4%b9%8b%e5%b7%a7%e7%94%a8sed%e8%bd%ac%e6%8d%a2mac%e5%9c%b0%e5%9d%80/#respond</comments>
		
		<dc:creator><![CDATA[shine]]></dc:creator>
		<pubDate>Mon, 16 Dec 2024 02:06:57 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MAC]]></category>
		<category><![CDATA[sed]]></category>
		<guid isPermaLink="false">https://www.lemonary.cn/?p=1064</guid>

					<description><![CDATA[原始MAC地址文件 首先，去掉冒号（准备工作） IEEE格式 华为交换机格式 思科交换机格式]]></description>
										<content:encoded><![CDATA[
<p>原始MAC地址文件</p>



<pre class="wp-block-code"><code>&#91;root@dameng linuxscript]# cat maclist 
D7:53:20:B3:E3:FE
1E:91:79:0D:B1:DB
4E:B0:1A:0D:11:D2
BF:59:7F:40:EF:6E
02:2D:F7:1A:90:EF
01:C6:16:66:B8:75
3F:09:9C:35:C4:B8
A0:B2:AC:30:04:31
D9:5D:1D:12:98:7A
9A:EE:FA:CD:39:90</code></pre>



<p><strong>首先，去掉冒号（准备工作）</strong></p>



<pre class="wp-block-code"><code>&#91;root@dameng linuxscript]# sed 's/://g' maclist 
D75320B3E3FE
1E91790DB1DB
4EB01A0D11D2
BF597F40EF6E
022DF71A90EF
01C61666B875
3F099C35C4B8
A0B2AC300431
D95D1D12987A
9AEEFACD3990</code></pre>



<p><strong>IEEE格式</strong></p>



<pre class="wp-block-code"><code>&#91;root@dameng linuxscript]# sed 's/://g' maclist | sed 's/\(..\)/\1-/g;s/-$//'
D7-53-20-B3-E3-FE
1E-91-79-0D-B1-DB
4E-B0-1A-0D-11-D2
BF-59-7F-40-EF-6E
02-2D-F7-1A-90-EF
01-C6-16-66-B8-75
3F-09-9C-35-C4-B8
A0-B2-AC-30-04-31
D9-5D-1D-12-98-7A
9A-EE-FA-CD-39-90</code></pre>



<p><strong>华为交换机格式</strong></p>



<pre class="wp-block-code"><code>&#91;root@dameng linuxscript]# sed 's/://g' maclist | sed 's/\(....\)/\1-/g;s/-$//'
D753-20B3-E3FE
1E91-790D-B1DB
4EB0-1A0D-11D2
BF59-7F40-EF6E
022D-F71A-90EF
01C6-1666-B875
3F09-9C35-C4B8
A0B2-AC30-0431
D95D-1D12-987A
9AEE-FACD-3990</code></pre>



<p><strong>思科交换机格式</strong></p>



<pre class="wp-block-code"><code>&#91;root@dameng linuxscript]# sed 's/://g' maclist | sed 's/\(....\)/\1./g;s/.$//'
D753.20B3.E3FE
1E91.790D.B1DB
4EB0.1A0D.11D2
BF59.7F40.EF6E
022D.F71A.90EF
01C6.1666.B875
3F09.9C35.C4B8
A0B2.AC30.0431
D95D.1D12.987A
9AEE.FACD.3990</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lemonary.cn/linux%e4%b8%89%e5%89%91%e5%ae%a2%e4%b9%8b%e5%b7%a7%e7%94%a8sed%e8%bd%ac%e6%8d%a2mac%e5%9c%b0%e5%9d%80/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
