<?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>Linux | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://sdt.hameba.tw</link>
	<description>由Steven, Der, Ted 三位高級打字員所組成，是三位工程師(攻城獅)所維護的技術分享平台，或許偶爾會分享一些日常，有任何問題或是錯誤的部分，歡迎留言告訴我們！</description>
	<lastBuildDate>Tue, 07 Jan 2020 16:51:43 +0800</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.3</generator>

<image>
	<url>https://sdt.hameba.tw/wp-content/uploads/2020/02/hameba_favicon-150x150.png</url>
	<title>Linux | SDT 攻城獅區</title>
	<link>https://sdt.hameba.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Linux 指令 ls 以時間做排序列出檔案</title>
		<link>https://sdt.hameba.tw/468/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-%25e6%258c%2587%25e4%25bb%25a4-ls-%25e4%25bb%25a5%25e6%2599%2582%25e9%2596%2593%25e5%2581%259a%25e6%258e%2592%25e5%25ba%258f%25e5%2588%2597%25e5%2587%25ba%25e6%25aa%2594%25e6%25a1%2588</link>
				<comments>https://sdt.hameba.tw/468/#respond</comments>
				<pubDate>Tue, 07 Jan 2020 16:51:43 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ls]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=468</guid>
				<description><![CDATA[<p>Linux 指令 ls 以時間排序列出檔案，上網查了一下文章，這邊做個筆記記錄一下。 [crayon-63de &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/468/" class="more-link">閱讀全文<span class="screen-reader-text">〈Linux 指令 ls 以時間做排序列出檔案〉</span></a></p>
The post <a href="https://sdt.hameba.tw/468/">Linux 指令 ls 以時間做排序列出檔案</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>Linux 指令 ls 以時間排序列出檔案，上網查了一下文章，這邊做個筆記記錄一下。</p>
<p><span id="more-468"></span></p><pre class="crayon-plain-tag"># 列出檔案，如果要以修改檔案的時間排序，只要加入參數 -t 即可
# 預設都會由最近的時間開始往下排
ls -lt

# 如果順序要由遠到近的話，只要在補上參數 -r 即可
ls -ltr</pre><p>如果不確定是否真的是按造修改的時間來排序，可以使用 <code>touch</code> 指令，來更改指定檔案或目錄的時間戳記 ，然後再馬上以 <code>ls -lt</code> 指令查看修改時間，通常被 touch 指令的檔案都會跑到最上面，因為他的更動時間已經被更改了。</p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/468/">Linux 指令 ls 以時間做排序列出檔案</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/468/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Linux crontab 直接重新讀取</title>
		<link>https://sdt.hameba.tw/354/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-crontab-%25e7%259b%25b4%25e6%258e%25a5%25e9%2587%258d%25e6%2596%25b0%25e8%25ae%2580%25e5%258f%2596</link>
				<comments>https://sdt.hameba.tw/354/#respond</comments>
				<pubDate>Fri, 20 Dec 2019 14:28:14 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=354</guid>
				<description><![CDATA[<p>Linux的crontab排程服務， 設定完成後，可以不用重新開機直接reload，指令如下: [crayon &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/354/" class="more-link">閱讀全文<span class="screen-reader-text">〈Linux crontab 直接重新讀取〉</span></a></p>
The post <a href="https://sdt.hameba.tw/354/">Linux crontab 直接重新讀取</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>Linux的crontab排程服務，</p>
<p>設定完成後，可以不用重新開機直接reload，指令如下:</p>
<p><span id="more-354"></span></p><pre class="crayon-plain-tag">$ sudo service cron reload

# or

$ /etc/init.d/cron reload</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://stackoverflow.com/questions/10193788/restarting-cron-after-changing-crontab-file">https://stackoverflow.com/questions/10193788/restarting-cron-after-changing-crontab-file</a></p>The post <a href="https://sdt.hameba.tw/354/">Linux crontab 直接重新讀取</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/354/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Linux 查看CPU型號、核心數量、頻率、溫度、記憶體</title>
		<link>https://sdt.hameba.tw/344/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-%25e6%259f%25a5%25e7%259c%258bcpu%25e5%259e%258b%25e8%2599%259f%25e3%2580%2581%25e6%25a0%25b8%25e5%25bf%2583%25e6%2595%25b8%25e9%2587%258f%25e3%2580%2581%25e9%25a0%25bb%25e7%258e%2587%25e3%2580%2581%25e6%25ba%25ab%25e5%25ba%25a6%25e3%2580%2581%25e8%25a8%2598%25e6%2586%25b6%25e9%25ab%2594</link>
				<comments>https://sdt.hameba.tw/344/#respond</comments>
				<pubDate>Fri, 20 Dec 2019 12:44:23 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[溫度]]></category>
		<category><![CDATA[記憶體]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=344</guid>
				<description><![CDATA[<p>習慣使用terminal的開發者，當要查詢硬體資訊也會習慣用指令， 反而不習慣用GUI點擊，作者從GUI要找到 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/344/" class="more-link">閱讀全文<span class="screen-reader-text">〈Linux 查看CPU型號、核心數量、頻率、溫度、記憶體〉</span></a></p>
The post <a href="https://sdt.hameba.tw/344/">Linux 查看CPU型號、核心數量、頻率、溫度、記憶體</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>習慣使用terminal的開發者，當要查詢硬體資訊也會習慣用指令，</p>
<p>反而不習慣用GUI點擊，作者從GUI要找到我想要看的資訊，就找得眼花撩亂，</p>
<p><span id="more-344"></span></p>
<p>還不如學幾個指令直接查詢自己想看的硬體資訊。</p>
<ul>
<li>CPU</li>
</ul>
<p></p><pre class="crayon-plain-tag">$ cat /proc/cpuinfo

# 每秒自動取得目前的CPU頻率
watch -n 1 "lscpu"</pre><p>接著會將CPU所有核心(包含虛擬核心)的資訊個別列出，包含核心號碼、型號、頻率(即時運行頻率)和快取大小。</p>
<ul>
<li>lscpu</li>
</ul>
<p></p><pre class="crayon-plain-tag">$ lscpu</pre><p>lscpu可以取得CPU的架構(x86, x86_64&#8230;等等)、核心數量、執行緒數量、頻率(從不同核心的運行頻率中挑選最大的來顯示)和快取大小。</p>
<ul>
<li>cpuinfo</li>
</ul>
<p></p><pre class="crayon-plain-tag"># 抓取各個核心的運行頻率
$ cat /proc/cpuinfo | grep MHz

# 每秒自動取得目前的CPU頻率
watch -n 1 "cat /proc/cpuinfo | grep MHz"</pre><p></p>
<ul>
<li>查看CPU的溫度</li>
</ul>
<p></p><pre class="crayon-plain-tag">$ sudo apt-get install lm-sensors

# 使用「sensors-detect」指令開啟
$ yes | sudo sensors-detect

# 執行
$ sensors</pre><p></p>
<ul>
<li>free</li>
</ul>
<p></p><pre class="crayon-plain-tag"># 以 MB 作為單位
$ free -m

# 以 GB 作為單位
$ free -g</pre><p>free顯示實體記憶體和 SWAP 的大小及使用狀況。</p>
<ul>
<li>Memory</li>
</ul>
<p></p><pre class="crayon-plain-tag">$ cat /proc/meminfo</pre><p>/proc/meminfo 檔案儲存更詳細的記憶體用量的資訊。</p>
<ul>
<li>工作管理員</li>
</ul>
<p></p><pre class="crayon-plain-tag">$ top</pre><p>等同於windwow系統工作管理員所看到的資訊，除了記憶體外還有CPU跟相關的執行程式資訊。</p>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://magiclen.org/linux-view-cpu/">https://magiclen.org/linux-view-cpu/</a></p>
<p><a href="https://www.opencli.com/linux/linux-check-ram-usage-spec">https://www.opencli.com/linux/linux-check-ram-usage-spec</a></p>The post <a href="https://sdt.hameba.tw/344/">Linux 查看CPU型號、核心數量、頻率、溫度、記憶體</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/344/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>如何在 Linux 上看到隱藏檔案</title>
		<link>https://sdt.hameba.tw/326/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e5%259c%25a8-linux-%25e4%25b8%258a%25e7%259c%258b%25e5%2588%25b0%25e9%259a%25b1%25e8%2597%258f%25e6%25aa%2594%25e6%25a1%2588</link>
				<comments>https://sdt.hameba.tw/326/#respond</comments>
				<pubDate>Tue, 10 Dec 2019 05:51:21 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ls]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=326</guid>
				<description><![CDATA[<p>在 Linux 環境中，要列出該目錄的檔案清單， 常常會使用到『 ls 』這個指令。 那如果想要看到隱藏檔案的 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/326/" class="more-link">閱讀全文<span class="screen-reader-text">〈如何在 Linux 上看到隱藏檔案〉</span></a></p>
The post <a href="https://sdt.hameba.tw/326/">如何在 Linux 上看到隱藏檔案</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>在 Linux 環境中，要列出該目錄的檔案清單，</p>
<p>常常會使用到『 ls 』這個指令。</p>
<p><span id="more-326"></span></p>
<p>那如果想要看到隱藏檔案的話，</p>
<p>這時候指令就要加上一些參數了。</p>
<ul>
<li>-a 列出隱藏檔案</li>
<li>-l 列出檔案權限、檔案擁有者、擁有者群組、檔案大小、修改日期</li>
</ul>
<p>通常會搭配使用，如下：</p><pre class="crayon-plain-tag">ls -al</pre><p>這樣就可以清楚地知道檔案的資訊了！</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>參考資料：</p>
<p><a href="http://linux.vbird.org/linux_basic/0220filemanager.php#ls">http://linux.vbird.org/linux_basic/0220filemanager.php#ls</a></p>The post <a href="https://sdt.hameba.tw/326/">如何在 Linux 上看到隱藏檔案</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/326/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Linux 背景執行 Screen</title>
		<link>https://sdt.hameba.tw/284/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-%25e8%2583%258c%25e6%2599%25af%25e5%259f%25b7%25e8%25a1%258c-screen</link>
				<comments>https://sdt.hameba.tw/284/#respond</comments>
				<pubDate>Sat, 07 Dec 2019 15:26:57 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Screen]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=284</guid>
				<description><![CDATA[<p>通常系統做好後，會遠端ssh進入linux系統 假設做到更新時dist-upgrade這種，如果發生斷線後 系 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/284/" class="more-link">閱讀全文<span class="screen-reader-text">〈Linux 背景執行 Screen〉</span></a></p>
The post <a href="https://sdt.hameba.tw/284/">Linux 背景執行 Screen</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>通常系統做好後，會遠端ssh進入linux系統</p>
<p>假設做到更新時dist-upgrade這種，如果發生斷線後</p>
<p><span id="more-284"></span></p>
<p>系統大概會出問題的機率都很高，所以會改成背景執行</p>
<p>Screen就是可以背景執行的好物</p><pre class="crayon-plain-tag"># 安裝Screen
$ sudo apt-get install screen</pre><p></p>
<h3><code>screen</code> 參數表</h3>
<table class="post-table">
<tbody>
<tr>
<td class="header"><code>screen</code> 參數</td>
<td class="header">說明</td>
</tr>
<tr>
<td><code>-c file</code></td>
<td>使定使用的設定檔（預設為 <code>$HOME/.screenrc</code>）</td>
</tr>
<tr>
<td><code>-d [pid.tty.host]</code></td>
<td>強制將指定的 <code>screen</code> 工作環境卸離</td>
</tr>
<tr>
<td><code>-L</code></td>
<td>開啟自動紀錄功能</td>
</tr>
<tr>
<td><code>-ls</code> 或 <code>-list</code></td>
<td>列出目前所有執行中的 <code>screen</code> 工作環境</td>
</tr>
<tr>
<td><code>-r [pid.tty.host]</code></td>
<td>重新連接執行中的 <code>screen</code> 工作環境</td>
</tr>
<tr>
<td><code>-R</code></td>
<td>重新連接最近卸離的 <code>screen</code> 工作環境</td>
</tr>
<tr>
<td><code>-U</code></td>
<td>以 UTF-8 模式執行</td>
</tr>
<tr>
<td><code>-wipe [match]</code></td>
<td>將廢棄的 <code>screen</code> 工作環境清除</td>
</tr>
</tbody>
</table>
<h3><code>screen</code> 操作指令表</h3>
<table class="post-table">
<tbody>
<tr>
<td class="header"><code>screen</code> 參數</td>
<td class="header">說明</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>c</code></td>
<td>建立新 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>Ctrl</code> + <code>a</code></td>
<td>切換至上一個 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與數字鍵 <code>0</code> 到 <code>9</code></td>
<td>切換至指定編號的 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>n</code></td>
<td>切換至下一個的 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>p</code></td>
<td>切換至下一個的 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>w</code></td>
<td>列出目前所有的 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>"</code></td>
<td>列出目前所有的 <code>screen</code> 視窗，並可用上下鍵選擇要切換的設窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>k</code></td>
<td>關閉目前的 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>d</code></td>
<td>卸離 <code>screen</code> 工作環境</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>Esc</code> 鍵（或 <code>Ctrl</code> + <code>a</code> 與 <code>[</code>）</td>
<td>進入複製模式（copy mode），可用方向鍵操作捲軸，或用 <code>/</code> 與 <code>?</code> 來搜尋，按下空白鍵開始選取要複製的內容，選取完成後再按下第二次空白鍵，即可複製，隨後使用 <code>Ctrl</code> + <code>]</code> 可貼上複製的內容。</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>S</code></td>
<td>將畫面分割成上下兩個區域</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>Q</code></td>
<td>關閉分割畫面</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>Tab</code> 鍵</td>
<td>切換分割畫面</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>t</code></td>
<td>顯示目前系統的時間與負載狀況</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>a</code></td>
<td>送出 <code>Ctrl</code> + <code>a</code></td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>?</code></td>
<td>顯示說明</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>v</code></td>
<td>顯示版本資訊</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>x</code></td>
<td>鎖定 <code>screen</code> 螢幕</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>H</code></td>
<td>開啟或結束 <code>screen</code> 紀錄功能</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>C</code></td>
<td>清除 <code>screen</code> 視窗中的內容</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code>、<code>D</code> 與 <code>D</code></td>
<td>強力卸離，卸離 <code>screen</code> 工作環境之後，直接登出</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>Ctrl</code> + <code>g</code></td>
<td>視覺化鈴聲（visual bell）切換</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>i</code></td>
<td>顯示目前 <code>screen</code> 視窗的資訊</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>l</code></td>
<td>重繪目前 <code>screen</code> 視窗的內容</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://blog.gtwang.org/linux/screen-command-examples-to-manage-linux-terminals/2/">https://blog.gtwang.org/linux/screen-command-examples-to-manage-linux-terminals/2/</a></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/284/">Linux 背景執行 Screen</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/284/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
