<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[Linux Cut命令基本用法，grep INCREMENTAL_STEP /backup/3306/cycle_file  cut -d= -f2,-d后面就是分割符，砍甘蔗。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Thu, 22 Jun 2017 15:53:48 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	save_cycle_data &#124;&#124; &#123; echo &#039;save cycle data failed&#039; &amp;&amp; exit 1; &#125;&nbsp;&nbsp;#调用函数失败的写法<br/>basedir=$(cd &quot;$(dirname &quot;$0&quot;)&quot;;pwd)<br/>echo $basedir<br/><br/>cat /backup/3306/cycle_file <br/>BASE_ID=base-2018-06-11-1203<br/>INCREMENTAL_STEP=20534973839<br/>LAST_LSN=2<br/>获取到等号后面的位置：<br/><textarea name="code" class="php" rows="15" cols="100">
grep INCREMENTAL_STEP /backup/3306/cycle_file &#124; cut -d= -f2
20534973839

grep BASE_ID /backup/3306/cycle_file&#124; cut -d= -f2
base-2018-06-11-1203

grep LAST_LSN /backup/3306/cycle_file &#124; cut -d= -f2
2
</textarea><br/><br/>获取INNODB的Last checkpoint at:<br/><textarea name="code" class="php" rows="15" cols="100">
mysql -e &#039;show engine innodb status&#92;G&#039;&#124;grep &#039;Last checkpoint at&#039;&#124;awk &#039;&#123;print $NF&#125;&#039;;
20544229853
[root@baige_mysql_bj_sjs_10_71_183_144 mysql_xtrabackup]# mysql -e &#039;show engine innodb status&#92;G&#039;
Log sequence number 20547216141
Log flushed up to&nbsp;&nbsp; 20547215666
Pages flushed up to 20544229853
Last checkpoint at&nbsp;&nbsp;20544229853
</textarea><br/><br/>参数之f3,砍断后第三节，如下：<br/><br/>$git branch -a&#124;grep -v &quot;*&quot; &#124; grep -v &quot;&gt;&quot;<br/>&nbsp;&nbsp;master<br/>&nbsp;&nbsp;remotes/origin/dev<br/>&nbsp;&nbsp;remotes/origin/master<br/><br/><br/>Cut上来：<br/><br/>$git branch -a&#124;grep -v &quot;*&quot; &#124; grep -v &quot;&gt;&quot;&#124;cut -d &quot;/&quot; -f3<br/>&nbsp;&nbsp;master<br/>dev<br/>master<br/><br/><br/><br/>sed 去空格和Tab：<br/><br/>git branch -a&#124;grep -v &quot;*&quot; &#124; grep -v &quot;&gt;&quot;&#124;cut -d &quot;/&quot; -f3&#124;sed &quot;s/^[ &#92;t]*//g&quot;<br/><br/><br/><br/>去掉重复行：<br/><br/>$git branch -a&#124;grep -v &quot;*&quot; &#124; grep -v &quot;&gt;&quot;&#124;cut -d &quot;/&quot; -f3&#124;sed &quot;s/^[ &#92;t]*//g&quot;<br/>master<br/>dev<br/>master<br/><br/><br/><br/>按正顺序sort:(反着排序 -r)<br/><br/>$git branch -a&#124;grep -v &quot;*&quot; &#124; grep -v &quot;&gt;&quot;&#124;cut -d &quot;/&quot; -f3&#124;sed &quot;s/^[ &#92;t]*//g&quot;&#124;sort<br/>dev<br/>master<br/>master<br/><br/><br/><br/>uniq上来去重：<br/><br/>git branch -a&#124;grep -v &quot;*&quot; &#124; grep -v &quot;&gt;&quot;&#124;cut -d &quot;/&quot; -f3&#124;sed &quot;s/^[ &#92;t]*//g&quot;&#124;sort&#124;uniq<br/><br/><br/><br/>防止太多，限制10条，head -10上来：<br/><br/>git branch -a&#124;grep -v &quot;*&quot; &#124; grep -v &quot;&gt;&quot;&#124;cut -d &quot;/&quot; -f3&#124;sed &quot;s/^[ &#92;t]*//g&quot;&#124;sort&#124;uniq&#124;head -10<br/><br/><br/><br/><br/>当然，还有更简单的，不用git branch -a:<br/>主要是了解命令：<br/><br/>$git branch &#124;sed &quot;s# ##g&quot;&#124;sed &quot;s#*##&quot;<br/>dev<br/>master<br/><br/>addr:You have new mail in /var/spool/mail/root<br/><br/><br/>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] Linux Cut命令基本用法，grep INCREMENTAL_STEP /backup/3306/cycle_file  cut -d= -f2,-d后面就是分割符，砍甘蔗。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>