<?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>Kiến thức tin học &#8211; Tin tức công nghệ thông tin, quảng cáo trực tuyến, mạng xã hội và công nghệ</title>
	<atom:link href="https://tuvancongnghe.net/category/tu-van-cong-nghe/kien-thuc-tin-hoc/feed/" rel="self" type="application/rss+xml" />
	<link>https://tuvancongnghe.net</link>
	<description>Tin tức công nghệ thông tin, quảng cáo trực tuyến, mạng xã hội và công nghệ</description>
	<lastBuildDate>Tue, 20 Dec 2022 06:50:21 +0000</lastBuildDate>
	<language>vi</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.5</generator>
	<item>
		<title>Hạn chế việc sử dụng CPU đối với các Process trong Linux</title>
		<link>https://tuvancongnghe.net/han-che-viec-su-dung-cpu-doi-voi-cac-process-trong-linux/</link>
					<comments>https://tuvancongnghe.net/han-che-viec-su-dung-cpu-doi-voi-cac-process-trong-linux/#respond</comments>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Wed, 23 May 2012 09:52:19 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[câu lệnh trong linux]]></category>
		<category><![CDATA[quản trị linux]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=2204</guid>

					<description><![CDATA[Bạn đã từng trải nghiệm tình huống khi mở một ứng dụng (chẳng hạn như Firefox) và toàn hệ thống sau đó bị ngừng lại? Nếu đang điều hành một máy chủ web, thứ cuối cùng mà bạn thấy sẽ là có một ứng dụng làm đổ vỡ toàn bộ hệ thống và tất cả [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Bạn đã từng trải nghiệm tình huống khi mở một ứng dụng (chẳng hạn như Firefox) và toàn hệ thống sau đó bị ngừng lại? Nếu đang điều hành một máy chủ web, thứ cuối cùng mà bạn thấy sẽ là có một ứng dụng làm đổ vỡ toàn bộ hệ thống và tất cả các website bị sập.</p>
<p>Cpulimit là một ứng dụng cho Linux, nó có thể hạn chế việc sử dụng CPU của một quá trình nào đó. Đây là một công cụ hết sức hữu dụng nếu bạn muốn hạn chế một ứng dụng nào đó đang ngốn quá nhiều tài nguyên CPU và là nguyên nhân gây ra đổ vỡ toàn bộ hệ thống. Ứng dụng cũng hết sức hữu dụng khi bạn cần chạy đồng thời một vài chương trình quan trọng.</p>
<p><strong>Lưu ý</strong>: <em>Cpulimit có thể làm việc với tất cả các phân phối Linux. Trong hướng dẫn này chúng tôi sẽ sử dụng Ubuntu làm ví dụ điển hình.</em></p>
<p><strong>Cài đặt</strong></p>
<p>Trong Ubuntu, bạn có thể cài đặt <em>cpulimit</em> thông qua Ubuntu Software Center hoặc đánh vào lệnh dưới đây trong terminal:</p>
<p>sudo apt-get install cpulimit</p>
<div><span style="color: #0000ff;"><strong>Sử dụng</strong></span></div>
<p>Để hạn chế một quá trình, hãy sử dụng lệnh dưới đây</p>
<p>sudo cpulimit -p PID -l CPU%</p>
<p><strong>PID</strong> là process ID của một ứng dụng đang chạy, còn <strong>CPU%</strong> là phần trăm (0-100) tài nguyên CPU được cấp phép cho ứng dụng. Bạn có thể lấy PID từ <em>System -&gt; Administration -&gt; System Monitor </em>.</p>
<p><a href="http://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit2.jpg"><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-2205" title="cpulimit2" src="http://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit2.jpg" alt="" width="577" height="490" srcset="https://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit2.jpg 577w, https://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit2-300x254.jpg 300w" sizes="(max-width: 577px) 100vw, 577px" /></a></p>
<p>Từ hình trên, bạn có thể thấy rằng ứng dụng Swiftfox (một biến thể của Firefox) ngốn mất 68% tài nguyên CPU trước khi thiết lập hạn chế. Hãy xem điều gì sẽ xảy ra khi chúng ta hạn chế hiệu suất sử dụng của nó xuống còn 20%.</p>
<p><a href="http://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit3.jpg"><img decoding="async" class="aligncenter size-full wp-image-2207" title="cpulimit3" src="http://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit3.jpg" alt="" width="443" height="142" srcset="https://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit3.jpg 443w, https://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit3-300x96.jpg 300w" sizes="(max-width: 443px) 100vw, 443px" /></a></p>
<p><a href="http://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit4.jpg"><img decoding="async" class="aligncenter size-full wp-image-2208" title="cpulimit4" src="http://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit4.jpg" alt="" width="577" height="491" srcset="https://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit4.jpg 577w, https://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit4-300x255.jpg 300w" sizes="(max-width: 577px) 100vw, 577px" /></a></p>
<p>% CPU lúc này được hạ thấp xuống 20% và không bao giờ vượt qua ngưỡng 20% này.</p>
<p><span style="color: #0000ff;"><strong>Mở rộng cpulimit – Tự động hóa toàn bộ quá trình</strong></span></p>
<p>Cpulimit rất hữu dụng khi bạn bắt gặp một ứng dụng nào đó ngốn nhiều tài nguyên CPU hoặc cần phải thực hiện một cụm công việc. Ngoài ra, bạn cũng có thể sử dụng chương trình trong việc tìm ra ứng dụng bị lỗi trong toàn bộ hệ thống. Đây là một ứng dụng đặc biệt hữu dụng trong thiết lập máy chủ.</p>
<p><em>abcuser</em> từ Ubuntu Forum có đi kèm với một kịch bản tự động hóa việc kiểm tra hệ thống và hạn chế bất cứ quá trình nào vượt quá giới hạn CPU đặt trước. Kịch bản này cũng cho phép bạn thiết lập danh sách đen hoặc danh sách trắng cho các ứn dụng cụ thể.</p>
<p>Trước khi bắt đầu, cần bảo đảm bạn đã cài đặt <em>cpulimit</em> và <em>gawk.</em></p>
<p>sudo apt-get install cpulimit gawk</p>
<div>Download các kịch bản <a href="http://dl.dropbox.com/u/6864546/cpulimit.tar.gz" target="_blank">tại đây</a>. Sau đó tiến hành bung file tar vào thư mục Home của bạn. Bạn sẽ có hai file bên trong thư mục cpulimit đó là: <strong>cpulimit_daemon.sh</strong> và <strong>cpulimit</strong>.</div>
<p>Mở file <em>cpulimit_daemon.sh</em> trong bộ soạn thảo văn bản của bạn (gEdit) và thay đổi như dưới đây:</p>
<p><strong><a href="http://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit5.jpg"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2206" title="cpulimit5" src="http://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit5.jpg" alt="" width="585" height="427" srcset="https://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit5.jpg 585w, https://tuvancongnghe.net/wp-content/uploads/2012/05/cpulimit5-300x218.jpg 300w" sizes="(max-width: 585px) 100vw, 585px" /></a>CPU_LIMIT</strong>: Đây là tài nguyên CPU tối đa có sẵn cho mỗi ứng dụng. Giá trị mặc định là 20%.</p>
<p><strong>DAEMON_INTERVAL</strong>: Đây là khoảng thời gian để kịch bản kiểm tra hệ thống. Mặc định được thiết lập là 3 giây.</p>
<p><strong>BLACK_PROCESS_LIST</strong>: Danh sách này gồm có các mục muốn kiểm tra. Bạn có thể sử dụng dấu “|” để nhóm thêm các quá trình. Cho ví dụ như, “mysql|firefox|gedit”.</p>
<p><strong>WHITE_PROCESSES_LIST</strong>: Danh sách gồm có các mục mà bạn không muốn kiểm tra. Bạn có thể sử dụng dấu “|” để nhóm thêm các quá trình. Ví dụ như, “mysql|firefox|gedit”.</p>
<p><strong>Lưu ý</strong>: <em>Một hoặc cả hai biến</em> <em>BLACK_PROCESSES_LIST và WHITE_PROCESSES_LIST phải trống rỗng.</em><em> Bạn không thể có một danh sách đen và một danh sách trắng tại cùng thời điểm.</em></p>
<p><span style="color: #0000ff;"><strong>Thiết lập</strong></span></p>
<p>Copy file <em>cpulimit_daemon.sh</em> vào thư mục /usr/bin/</p>
<p>sudo cp ~/cpulimit/cpulimit_daemon.sh /usr/bin</p>
<p>sudo chmod 700 /usr/bin/cpulimit_daemon.sh</p>
<p>Copy file <em>cpulimit</em> vào thư mục /etc/init.d/, thiết lập điều khoản cần thiết và thiết lập chạy trong quá trình khởi động.</p>
<p>sudo cp ~/cpulimit/cpulimit /etc/init.d/</p>
<p>sudo chown root:root /etc/init.d/cpulimit</p>
<p>sudo chmod +x /etc/init.d/cpulimit</p>
<p>sudo update-rc.d cpulimit defaults</p>
<p>Khởi động lại hệ thống. Cpulimit sẽ khởi chạy hoàn toàn tự động.</p>
<p>Bạn có thể mở một terminal và đánh:</p>
<p>sudo service cpulimit status</p>
<p>để kiểm tra xem cpulimit hiện có hoạt động hay không. Nếu không chạy, hãy thực hiện chạy bằng dòng lệnh</p>
<p>sudo service cpulimit start</p>
<p>Và có thể stop nó bằng:</p>
<p>sudo service cpulimit stop</p>
<p><span style="color: #0000ff;"><strong>Hủy bỏ cài đặt</strong></span></p>
<p>Để hủy bỏ cài đặt, đây là những gì bạn cần thực hiện:</p>
<p>1. Stop chương trình.</p>
<p>sudo service cpulimit stop  # Stop cpulimit daemon and all cpulimited processes</p>
<p>2. Remove chương trình khỏi thủ tục khởi động</p>
<p>sudo update-rc.d -f cpulimit remove    # Remove symbolic links</p>
<p>3. Xóa thủ tục khởi động</p>
<p>sudo rm /etc/init.d/cpulimit           # Delete cpulimit boot-up script</p>
<p>4. Xóa <em>cpulimit</em></p>
<p>sudo rm /usr/bin/cpulimit_daemon.sh    # Delete cpulimit daemon script</p>
<p>5. Hủy cài đặt chương trình <em>cpulimit</em></p>
<p>sudo apt-get remove cpulimit</p>
<p>Có thể hủy cài đặt chương trình <em>gawk</em></p>
<p>sudo apt-get remove gawk</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tuvancongnghe.net/han-che-viec-su-dung-cpu-doi-voi-cac-process-trong-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Cách tạo Fan Page trên Face Book</title>
		<link>https://tuvancongnghe.net/cach-tao-fan-page-tren-face-book/</link>
					<comments>https://tuvancongnghe.net/cach-tao-fan-page-tren-face-book/#respond</comments>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Fri, 06 Apr 2012 03:56:23 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[quảng cáo facebook]]></category>
		<category><![CDATA[tạo fan page]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=2167</guid>

					<description><![CDATA[CÁC BƯỚC CƠ BẢN Bước 1: Đăng nhập vào tài khoản Facebook của bạn. Bước 2: Vào đường link này để tạo trang: http://www.facebook.com/pages/create.php. Bạn có thể chọn tạo trang cộng đồng hoặc tạo trang thương mại. Hãy chọn tên cho trang của mình cẩn thận sau đó click vào mục khai báo tôi là [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>CÁC BƯỚC CƠ BẢN</h2>
<p><strong>Bước 1</strong>: Đăng nhập vào tài khoản Facebook của bạn.</p>
<p><strong>Bước 2</strong>: Vào đường link này để tạo trang: <a href="http://www.facebook.com/pages/create.php">http://www.facebook.com/pages/create.php</a>. Bạn có thể chọn tạo trang cộng đồng hoặc tạo trang thương mại. Hãy chọn tên cho trang của mình cẩn thận sau đó click vào mục khai báo tôi là chủ sở hữu của doanh nghiệp rồi bấm tạo trang.</p>
<p><a href="http://tuvancongnghe.net/wp-content/uploads/2012/04/tao-page-tren-facebook.gif"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2168" title="tao-page-tren-facebook" src="http://tuvancongnghe.net/wp-content/uploads/2012/04/tao-page-tren-facebook.gif" alt="" width="681" height="440" srcset="https://tuvancongnghe.net/wp-content/uploads/2012/04/tao-page-tren-facebook.gif 681w, https://tuvancongnghe.net/wp-content/uploads/2012/04/tao-page-tren-facebook-300x193.gif 300w" sizes="(max-width: 681px) 100vw, 681px" /></a></p>
<p><strong>Bước 3</strong>: Khi xong bước 2, bạn sẽ được đưa đến giao diện “Getting started” hoặc “Bắt đầu” nếu bạn dùng phiên bản tiếng Việt. Lần lượt hoàn tất 5 bước mặc định của Facebook, sau đó trang “Getting started” hoặc “Bắt đầu” sẽ tự động biến mất.</p>
<h2>THAY ĐỔI ẢNH ĐẠI DIỆN</h2>
<p>Nhìn phía bên dưới ảnh Avatar mặc định của bạn, sẽ thấy mục Chỉnh sửa trang. Hãy vào đó để được đưa đến giao diện chỉnh sửa. Trong giao diện này, bạn có thể sửa được:</p>
<ul>
<li>Quản lý quyền hạn</li>
<li>Thông tin cơ bản của trang</li>
<li>Chỉnh lại hình Avatar</li>
<li>Quảng cáo cho trang của bạn (phải trã tiền)</li>
<li>Quản lý quản trị</li>
<li>Cài đặt ứng dụng</li>
<li>…</li>
</ul>
<p>Trong bài viết này, tôi sẽ đi sâu vào mục <strong>Cài đặt ứng dụng</strong>.</p>
<h2>CÀI ĐẶT ỨNG DỤNG</h2>
<p>Khi chọn mục Cài đặt ứng dụng, bạn sẽ thấy được có 1 số ứng dụng đã để mặc định. Một số ứng dụng khác bên dưới được Face book gợi ý. Một trong những cái đó là FBML.</p>
<h3>Ứng dụng FBML</h3>
<p>FBML là ứng dụng giúp bạn có thể chèn các đoạn code HTML cơ bản vào trang của bạn. Hãy tưởng tượng trang của bạn sẽ phong phú và đầy màu sắc hơn rất nhiều với các hình ảnh hoặc banner thay vì là chữ và chữ như mặc định của Facebook. Để sử dụng FBML, bạn chỉ cần bấm vào mục <strong>Thêm ứng dụng</strong>. Khi bấm xong, ứng dụng FBML sẽ nhảy lên giao diện các ứng dụng đã được cài đặt.</p>
<p>Để sử dụng FBML, bạn chỉ cần bấm vào “<strong>Go to Application</strong>” bên dưới cái avatar của FBML, lúc đó nó sẽ hiện lên một giao diện cho phép bạn đặt Tiêu đề, bên dưới có thể để được đoạn mã quảng cáo HTML. Nếu bạn muốn copy mã quảng cáo Stuguads, chỉ cần copy nó vào đây.</p>
<p>Sau đó, bạn có thể trở ra giao diện Trang của mình, bạn sẽ thấy được Tab FBML mà bạn đã cấu hình.</p>
<p>Chúc bạn thành công.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tuvancongnghe.net/cach-tao-fan-page-tren-face-book/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>TVCN: Các plugin tăng lượng traffic cho website wordpress</title>
		<link>https://tuvancongnghe.net/tvcn-cac-plugin-tang-luong-traffic-cho-website-wordpress/</link>
					<comments>https://tuvancongnghe.net/tvcn-cac-plugin-tang-luong-traffic-cho-website-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Sat, 17 Sep 2011 16:33:56 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[dịch vụ seo]]></category>
		<category><![CDATA[kỹ thuật seo website]]></category>
		<category><![CDATA[tăng traffic cho website]]></category>
		<category><![CDATA[tu van lam seo]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=1934</guid>

					<description><![CDATA[Có được thứ hạng cao trên các cỗ máy tìm kiếm mang lại rất nhiều lượng viếng thăm đến cho blog của bạn và SEO là 1 trong những kĩ thuật cần thiết để làm điều đó. Đối với WordPress, có rất nhiều plug-in có thể giúp bạn làm điều này. Sau đây là 5 plug-in [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Có được thứ hạng cao trên các cỗ máy tìm kiếm mang lại rất nhiều lượng viếng thăm đến cho blog của bạn và SEO là 1 trong những kĩ thuật cần thiết để làm điều đó. Đối với WordPress, có rất nhiều plug-in có thể giúp bạn làm điều này. Sau đây là 5 plug-in tốt nhất để tăng lượng traffic đến blog của bạn từ search engine.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1935" title="tang-traffic-cho-website-wordpress" src="http://tuvancongnghe.net/wp-content/uploads/2011/09/tang-traffic-cho-website-wordpress.jpg" alt="" width="430" height="334" srcset="https://tuvancongnghe.net/wp-content/uploads/2011/09/tang-traffic-cho-website-wordpress.jpg 430w, https://tuvancongnghe.net/wp-content/uploads/2011/09/tang-traffic-cho-website-wordpress-300x233.jpg 300w" sizes="(max-width: 430px) 100vw, 430px" /></p>
<p><strong>1. All in One SEO Pack</strong></p>
<p>Đây là plug-in giúp bạn giúp bạn có thể thêm các thẻ tag vào trong post của mình giúp cho search engine có thể hiểu được nội dung của bài blog/post của bài hơn. Ngoài ra, bạn còn có thể chọn loại bỏ 1 trang/mục/blog ra khỏi danh sách index của các search engine. Plugin này rất dễ dùng và cũng chất lượng cao nữa. Bạn nào sở hữu blog mà chưa cài thì cài nhanh nhanh nhé.</p>
<p><strong>2. Broken Link Checker</strong></p>
<p>Plug-in này theo dõi những đường link trên site của bạn và liệt kê những link nào đã chết hay những bài viết nào mất hình ảnh do link die. Plug-in này rất cần thiết bởi vì nó giúp giảm thiểu số lượng lỗi từ website mỗi khi search engine đánh chỉ mục cho website của bạn.</p>
<p>3. Google XML Sitemaps Generator</p>
<p>Plugin này tạo 1 Google XML Sitemap cho log của bạn. 1 sitemap tuy không yêu cầu nhưng rất cần thiết để giúp các search engine có thể nhìn thấy được hết các ngóc ngách trong website của bạn. Ngoài ra, plug-in còn có thể được dùng cho các search engine khác như Yahoo, Bing và Ask.com.</p>
<p><strong>4. SEO Friendly Images</strong></p>
<p>SEO Friendly Images là 1 plugin giúp tự động hóa việc chỉnh sửa alt tag và title tag của hình ảnh. Bằng việc cài đặt plug-in này, website của bạn có được 2 lợi thế. Một là website của bạn sẽ hợp với chuẩn W3C. 2 là hình ảnh trên website của bạn sẽ có cơ hội xuất hiện trên Google Image Search cao hơn.</p>
<p><strong>5. No Self Pings</strong></p>
<p>Mặc dù những đường link liên kết trong website của bạn giúp người dùng định vị những bài post trong blog, thế nhưng việc có quá nhiều ping backs lại ảnh hưởng đến page rank của bạn trên Google. Plugin này sẽ loại bỏ hoàn toàn những ping backs này bằng việc thêm từ khóa “no follow” vào, qua đó nâng cao page rank của bạn lên nhiều hơn.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tuvancongnghe.net/tvcn-cac-plugin-tang-luong-traffic-cho-website-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Toàn bộ câu lệnh trong Linux</title>
		<link>https://tuvancongnghe.net/toan-bo-cau-lenh-trong-linux/</link>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Wed, 24 Aug 2011 08:35:12 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[câu lệnh trong linux]]></category>
		<category><![CDATA[command linux]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=1903</guid>

					<description><![CDATA[Toàn bộ câu lệnh sử dụng trong Server Linux từ A &#8211; Z Linux Commands Line A &#8211; Z A     Command Description # alias hh=&#8217;history&#8217; set an alias for a command &#8211; hh = history # apropos &#8230;keyword display a list of commands that pertain to keywords of a program , useful when you know [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2 style="text-align: center;">Toàn bộ câu lệnh sử dụng trong Server Linux từ A &#8211; Z</h2>
<p>Linux Commands Line A &#8211; Z</p>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%"><strong>A     Command</strong></td>
<td width="52%"><strong>Description </strong></td>
</tr>
<tr>
<td valign="top" width="48%"># alias hh=&#8217;history&#8217;</td>
<td valign="top" width="52%">set an alias for a command &#8211; hh = history</td>
</tr>
<tr>
<td valign="top" width="48%"># apropos &#8230;keyword</td>
<td valign="top" width="52%">display a list of commands that pertain to keywords of a program , useful when you know what your program does, but you don&#8217;t know the name of the command</td>
</tr>
<tr>
<td valign="top" width="48%"># apt-cache search [package]</td>
<td valign="top" width="52%">returns list of packages which corresponds string &#8220;searched-packages&#8221;</td>
</tr>
<tr>
<td valign="top" width="48%"># apt-cdrom install [package]</td>
<td valign="top" width="52%">install / upgrade a deb package from cdrom</td>
</tr>
<tr>
<td valign="top" width="48%"># apt-get install [package]</td>
<td valign="top" width="52%">install / upgrade a deb package</td>
</tr>
<tr>
<td valign="top" width="48%"># apt-get update</td>
<td valign="top" width="52%">update the package list</td>
</tr>
<tr>
<td valign="top" width="48%"># apt-get upgrade</td>
<td valign="top" width="52%">upgrade all of the installed packages</td>
</tr>
<tr>
<td valign="top" width="48%"># apt-get remove [package]</td>
<td valign="top" width="52%">remove a deb package from system</td>
</tr>
<tr>
<td valign="top" width="48%"># apt-get check</td>
<td valign="top" width="52%">verify correct resolution of dependencies</td>
</tr>
<tr>
<td valign="top" width="48%"># apt-get clean</td>
<td valign="top" width="52%">clean up cache from packages downloaded</td>
</tr>
<tr>
<td valign="top" width="48%"># arch</td>
<td valign="top" width="52%">show architecture of machine(1)</td>
</tr>
<tr>
<td valign="top" width="48%"># cat example.txt | awk &#8216;NR%2==1&#8217;</td>
<td valign="top" width="52%">remove all even lines from example.txt</td>
</tr>
<tr>
<td valign="top" width="48%"># echo a b c | awk &#8216;{print $1}&#8217;</td>
<td valign="top" width="52%">view the first column of a line</td>
</tr>
<tr>
<td valign="top" width="48%"># echo a b c | awk &#8216;{print $1,$3}&#8217;</td>
<td valign="top" width="52%">view the first and third column of a line</td>
</tr>
</tbody>
</table>
<table border="1" width="575" cellpadding="0" align="left">
<tbody>
<tr>
<td width="58%">B    Command</td>
<td width="40%">Description</td>
</tr>
<tr>
<td valign="top" width="58%"># badblocks -v /dev/hda1</td>
<td valign="top" width="40%">check bad blocks on disk hda1</td>
</tr>
<tr>
<td valign="top" width="58%"># bunzip2 file1.bz2</td>
<td valign="top" width="40%">decompress a file called &#8216;file1.bz2&#8217;</td>
</tr>
<tr>
<td valign="top" width="58%"># bzip2 file1</td>
<td valign="top" width="40%">compress a file called &#8216;file1&#8217;</td>
</tr>
<tr>
<td valign="top" width="58%"># find /var/log -name &#8216;*.log&#8217; | tar cv &#8211;files-from=- | bzip2 &gt; log.tar.bz2</td>
<td valign="top" width="40%">find all files with &#8216;.log&#8217; extention and make an bzip archive</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">C      Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># cal 2007</td>
<td valign="top" width="52%">show the timetable of 2007</td>
</tr>
<tr>
<td valign="top" width="48%"># cat /proc/cpuinfo</td>
<td valign="top" width="52%">show information CPU info</td>
</tr>
<tr>
<td valign="top" width="48%"># cat /proc/interrupts</td>
<td valign="top" width="52%">show interrupts</td>
</tr>
<tr>
<td valign="top" width="48%"># cat /proc/meminfo</td>
<td valign="top" width="52%">verify memory use</td>
</tr>
<tr>
<td valign="top" width="48%"># cat /proc/swaps</td>
<td valign="top" width="52%">show file(s) swap</td>
</tr>
<tr>
<td valign="top" width="48%"># cat /proc/version</td>
<td valign="top" width="52%">show version of the kernel</td>
</tr>
<tr>
<td valign="top" width="48%"># cat /proc/net/dev</td>
<td valign="top" width="52%">show network adpters and statistics</td>
</tr>
<tr>
<td valign="top" width="48%"># cat /proc/mounts</td>
<td valign="top" width="52%">show mounted file system(s)</td>
</tr>
<tr>
<td valign="top" width="48%"># cat file1</td>
<td valign="top" width="52%">view the contents of a file starting from the first row</td>
</tr>
<tr>
<td valign="top" width="48%"># cat -n file1</td>
<td valign="top" width="52%">number row of a file</td>
</tr>
<tr>
<td valign="top" width="48%"># cd /home</td>
<td valign="top" width="52%">enter to directory &#8216;/ home&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># cd ..</td>
<td valign="top" width="52%">go back one level</td>
</tr>
<tr>
<td valign="top" width="48%"># cd ../..</td>
<td valign="top" width="52%">go back two levels</td>
</tr>
<tr>
<td valign="top" width="48%"># cd</td>
<td valign="top" width="52%">go to home directory</td>
</tr>
<tr>
<td valign="top" width="48%"># cd ~user1</td>
<td valign="top" width="52%">go to home directory</td>
</tr>
<tr>
<td valign="top" width="48%"># cd &#8211;</td>
<td valign="top" width="52%">go to previous directory</td>
</tr>
<tr>
<td valign="top" width="48%"># cd-paranoia -B</td>
<td valign="top" width="52%">rip audio tracks from a CD to wav files</td>
</tr>
<tr>
<td valign="top" width="48%"># cd-paranoia &#8212;</td>
<td valign="top" width="52%">rip first three audio tracks from a CD to wav files</td>
</tr>
<tr>
<td valign="top" width="48%"># cdrecord -v gracetime=2 dev=/dev/cdrom -eject blank=fast -force</td>
<td valign="top" width="52%">clean a rewritable cdrom</td>
</tr>
<tr>
<td valign="top" width="48%"># cdrecord -v dev=/dev/cdrom cd.iso</td>
<td valign="top" width="52%">burn an ISO image</td>
</tr>
<tr>
<td valign="top" width="48%"># gzip -dc cd_iso.gz | cdrecord dev=/dev/cdrom &#8211;</td>
<td valign="top" width="52%">burn a compressed ISO image</td>
</tr>
<tr>
<td valign="top" width="48%"># cdrecord &#8211;scanbus</td>
<td valign="top" width="52%">scan bus to identify the channel scsi</td>
</tr>
<tr>
<td valign="top" width="48%"># chage -E 2005-12-31 user1</td>
<td valign="top" width="52%">set deadline for user password</td>
</tr>
<tr>
<td valign="top" width="48%"># chattr +a file1</td>
<td valign="top" width="52%">allows write opening of a file only append mode</td>
</tr>
<tr>
<td valign="top" width="48%"># chattr +c file1</td>
<td valign="top" width="52%">allows that a file is compressed / decompressed automatically by the kernel</td>
</tr>
<tr>
<td valign="top" width="48%"># chattr +d file1</td>
<td valign="top" width="52%">makes sure that the program ignores Dump the files during backup</td>
</tr>
<tr>
<td valign="top" width="48%"># chattr +i file1</td>
<td valign="top" width="52%">makes it an immutable file, which can not be removed, altered, renamed or linked</td>
</tr>
<tr>
<td valign="top" width="48%"># chattr +s file1</td>
<td valign="top" width="52%">allows a file to be deleted safely</td>
</tr>
<tr>
<td valign="top" width="48%"># chattr +S file1</td>
<td valign="top" width="52%">makes sure that if a file is modified changes are written in synchronous mode as with sync</td>
</tr>
<tr>
<td valign="top" width="48%"># chattr +u file1</td>
<td valign="top" width="52%">allows you to recover the contents of a file even if it is canceled</td>
</tr>
<tr>
<td valign="top" width="48%"># chgrp group1 file1</td>
<td valign="top" width="52%">change group of files</td>
</tr>
<tr>
<td valign="top" width="48%"># chmod ugo+rwx directory1</td>
<td valign="top" width="52%">set permissions reading (r), write (w) and (x) access to users owner (u) group (g) and others (o)</td>
</tr>
<tr>
<td valign="top" width="48%"># chmod go-rwx directory1</td>
<td valign="top" width="52%">remove permits reading (r), write (w) and (x) access to users group (g) and others (or</td>
</tr>
<tr>
<td valign="top" width="48%"># chmod u+s /bin/file1</td>
<td valign="top" width="52%">set SUID bit on a binary file &#8211; the user that running that file gets same privileges as owner</td>
</tr>
<tr>
<td valign="top" width="48%"># chmod u-s /bin/file1</td>
<td valign="top" width="52%">disable SUID bit on a binary file</td>
</tr>
<tr>
<td valign="top" width="48%"># chmod g+s /home/public</td>
<td valign="top" width="52%">set SGID bit on a directory &#8211; similar to SUID but for directory</td>
</tr>
<tr>
<td valign="top" width="48%"># chmod g-s /home/public</td>
<td valign="top" width="52%">disable SGID bit on a directory</td>
</tr>
<tr>
<td valign="top" width="48%"># chmod o+t /home/public</td>
<td valign="top" width="52%">set STIKY bit on a directory &#8211; allows files deletion only to legitimate owners</td>
</tr>
<tr>
<td valign="top" width="48%"># chmod o-t /home/public</td>
<td valign="top" width="52%">disable STIKY bit on a directory</td>
</tr>
<tr>
<td valign="top" width="48%"># chown user1 file1</td>
<td valign="top" width="52%">change owner of a file</td>
</tr>
<tr>
<td valign="top" width="48%"># chown -R user1 directory1</td>
<td valign="top" width="52%">change user owner of a directory and all the files and directories contained inside</td>
</tr>
<tr>
<td valign="top" width="48%"># chown user1:group1 file1</td>
<td valign="top" width="52%">change user and group ownership of a file</td>
</tr>
<tr>
<td valign="top" width="48%"># chsh</td>
<td valign="top" width="52%">change shell command</td>
</tr>
<tr>
<td valign="top" width="48%"># chsh &#8211;list-shells</td>
<td valign="top" width="52%">nice command to know if you have to remote into another box</td>
</tr>
<tr>
<td valign="top" width="48%"># clock -w</td>
<td valign="top" width="52%">save date changes on BIOS</td>
</tr>
<tr>
<td valign="top" width="48%"># comm -1 file1 file2</td>
<td valign="top" width="52%">compare contents of two files by deleting only unique lines from &#8216;file1&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># comm -2 file1 file2</td>
<td valign="top" width="52%">compare contents of two files by deleting only unique lines from &#8216;file2&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># comm -3 file1 file2</td>
<td valign="top" width="52%">compare contents of two files by deleting only the lines that appear on both files</td>
</tr>
<tr>
<td valign="top" width="48%"># cp file1 file2</td>
<td valign="top" width="52%">copying a file</td>
</tr>
<tr>
<td valign="top" width="48%"># cp dir/* .</td>
<td valign="top" width="52%">copy all files of a directory within the current work directory</td>
</tr>
<tr>
<td valign="top" width="48%"># cp -a /tmp/dir1 .</td>
<td valign="top" width="52%">copy a directory within the current work directory</td>
</tr>
<tr>
<td valign="top" width="48%"># cp -a dir1 dir2</td>
<td valign="top" width="52%">copy a directory</td>
</tr>
<tr>
<td valign="top" width="48%"># find /home/user1 -name &#8216;*.txt&#8217; | xargs cp -av &#8211;target-directory=/home/backup/ &#8211;parents</td>
<td valign="top" width="52%">find and copy all files with &#8216;.txt&#8217; extention from a directory to another</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">D      Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># date</td>
<td valign="top" width="52%">show system date</td>
</tr>
<tr>
<td valign="top" width="48%"># date 041217002007.00</td>
<td valign="top" width="52%">set date and time &#8211; MonthDayhoursMinutesYear.Seconds</td>
</tr>
<tr>
<td valign="top" width="48%"># dd bs=1M if=/dev/hda | gzip | ssh user@ip_addr &#8216;dd of=hda.gz&#8217;</td>
<td valign="top" width="52%">make a backup of a local hard disk on remote host via ssh</td>
</tr>
<tr>
<td valign="top" width="48%"># dd if=/dev/sda of=/tmp/file1</td>
<td valign="top" width="52%">backup content of the harddrive to a file</td>
</tr>
<tr>
<td valign="top" width="48%"># dd if=/dev/hda of=/dev/fd0 bs=512 count=1</td>
<td valign="top" width="52%">make a copy of MBR (Master Boot Record) to floppy</td>
</tr>
<tr>
<td valign="top" width="48%"># dd if=/dev/fd0 of=/dev/hda bs=512 count=1</td>
<td valign="top" width="52%">restore MBR from backup copy saved to floppy</td>
</tr>
<tr>
<td valign="top" width="48%"># df -h</td>
<td valign="top" width="52%">show list of partitions mounted</td>
</tr>
<tr>
<td valign="top" width="48%"># dhclient eth0</td>
<td valign="top" width="52%">active interface &#8216;eth0&#8217; in dhcp mode</td>
</tr>
<tr>
<td valign="top" width="48%"># diff file1 file2</td>
<td valign="top" width="52%">find differences between two files</td>
</tr>
<tr>
<td valign="top" width="48%"># dmidecode -q</td>
<td valign="top" width="52%">show hardware system components &#8211; (SMBIOS / DMI)</td>
</tr>
<tr>
<td valign="top" width="48%"># dos2unix filedos.txt fileunix.txt</td>
<td valign="top" width="52%">convert a text file format from MSDOS to UNIX</td>
</tr>
<tr>
<td valign="top" width="48%"># dosfsck /dev/hda1</td>
<td valign="top" width="52%">repair / check integrity of dos filesystems on disk hda1</td>
</tr>
<tr>
<td valign="top" width="48%"># dpkg-query -W -f=&#8217;${Installed-Size;10}t${Package}n&#8217; | sort -k1,1n</td>
<td valign="top" width="52%">show the used space by installed deb packages, sorting by size (debian, ubuntu and alike)</td>
</tr>
<tr>
<td valign="top" width="48%"># dpkg -i [package.deb]</td>
<td valign="top" width="52%">install / upgrade a deb package</td>
</tr>
<tr>
<td valign="top" width="48%"># dpkg -r [package]</td>
<td valign="top" width="52%">remove a deb package from the system</td>
</tr>
<tr>
<td valign="top" width="48%"># dpkg -l</td>
<td valign="top" width="52%">show all deb packages installed on the system</td>
</tr>
<tr>
<td valign="top" width="48%"># dpkg -l | grep httpd</td>
<td valign="top" width="52%">show all deb packages with the name &#8220;httpd&#8221;</td>
</tr>
<tr>
<td valign="top" width="48%"># dpkg -s [package]</td>
<td valign="top" width="52%">obtain information on a specific package installed on system</td>
</tr>
<tr>
<td valign="top" width="48%"># dpkg -L [package]</td>
<td valign="top" width="52%">show list of files provided by a package installed on system</td>
</tr>
<tr>
<td valign="top" width="48%"># dpkg &#8211;contents [package.deb]</td>
<td valign="top" width="52%">show list of files provided by a package not yet installed</td>
</tr>
<tr>
<td valign="top" width="48%"># dpkg -S /bin/ping</td>
<td valign="top" width="52%">verify which package belongs to a given file</td>
</tr>
<tr>
<td valign="top" width="48%"># du -sh dir1</td>
<td valign="top" width="52%">estimate space used by directory &#8216;dir1&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># du -sk * | sort -rn</td>
<td valign="top" width="52%">show size of the files and directories sorted by size</td>
</tr>
<tr>
<td valign="top" width="48%"># dump -0aj -f /tmp/home0.bak /home</td>
<td valign="top" width="52%">make a full backup of directory &#8216;/home&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># dump -1aj -f /tmp/home0.bak /home</td>
<td valign="top" width="52%">make a incremental backup of directory &#8216;/home&#8217;</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">E     Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># e2fsck /dev/hda1</td>
<td valign="top" width="52%">repair / check integrity of ext2 filesystem on disk hda1</td>
</tr>
<tr>
<td valign="top" width="48%"># e2fsck -j /dev/hda1</td>
<td valign="top" width="52%">repair / check integrity of ext3 filesystem on disk hda1</td>
</tr>
<tr>
<td valign="top" width="48%"># ethtool eth0</td>
<td valign="top" width="52%">show network statistics of eth0</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">F   Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># fdformat -n /dev/fd0</td>
<td valign="top" width="52%">format a floppy disk</td>
</tr>
<tr>
<td valign="top" width="48%"># cp file file1</td>
<td valign="top" width="52%">outputs the mime type of the file as text</td>
</tr>
<tr>
<td valign="top" width="48%"># find / -name file1</td>
<td valign="top" width="52%">search file and directory into root filesystem from &#8216;/&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># find / -user user1</td>
<td valign="top" width="52%">search files and directories belonging to &#8216;user1&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># find /home/user1 -name \*.bin</td>
<td valign="top" width="52%">search files with &#8216;. bin&#8217; extension within directory &#8216;/ home/user1&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># find /usr/bin -type f -atime +100</td>
<td valign="top" width="52%">search binary files are not used in the last 100 days</td>
</tr>
<tr>
<td valign="top" width="48%"># find /usr/bin -type f -mtime -10</td>
<td valign="top" width="52%">search files created or changed within 10 days</td>
</tr>
<tr>
<td valign="top" width="48%"># find / -name *.rpm -exec chmod 755 &#8216;{}&#8217; \;</td>
<td valign="top" width="52%">search files with &#8216;.rpm&#8217; extension and modify permits</td>
</tr>
<tr>
<td valign="top" width="48%"># find / -xdev -name \*.rpm</td>
<td valign="top" width="52%">search files with &#8216;.rpm&#8217; extension ignoring removable partitions as cdrom, pen-drive, etc.…</td>
</tr>
<tr>
<td valign="top" width="48%"># find / -perm -u+s</td>
<td valign="top" width="52%">view all files on the system with SUID configured</td>
</tr>
<tr>
<td valign="top" width="48%"># free -m</td>
<td valign="top" width="52%">displays status of RAM in megabytes</td>
</tr>
<tr>
<td valign="top" width="48%"># fsck /dev/hda1</td>
<td valign="top" width="52%">repair / check integrity of linux filesystem on disk hda1</td>
</tr>
<tr>
<td valign="top" width="48%"># fsck.ext2 /dev/hda1</td>
<td valign="top" width="52%">repair / check integrity of ext2 filesystem on disk hda1</td>
</tr>
<tr>
<td valign="top" width="48%"># fsck.ext3 /dev/hda1</td>
<td valign="top" width="52%">repair / check integrity of ext3 filesystem on disk hda1</td>
</tr>
<tr>
<td valign="top" width="48%"># fsck.vfat /dev/hda1</td>
<td valign="top" width="52%">repair / check integrity of fat filesystem on disk hda1</td>
</tr>
<tr>
<td valign="top" width="48%"># fsck.msdos /dev/hda1</td>
<td valign="top" width="52%">repair / check integrity of dos filesystem on disk hda1</td>
</tr>
<tr>
<td valign="top" width="48%"># fuser -km /mnt/hda2</td>
<td valign="top" width="52%">force umount when the device is busy</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">G     Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># gpg -c file1</td>
<td valign="top" width="52%">encrypt a file with GNU Privacy Guard</td>
</tr>
<tr>
<td valign="top" width="48%"># gpg file1.gpg</td>
<td valign="top" width="52%">decrypt a file with GNU Privacy Guard</td>
</tr>
<tr>
<td valign="top" width="48%"># grep Aug /var/log/messages</td>
<td valign="top" width="52%">look up words &#8220;Aug&#8221; on file &#8216;/var/log/messages&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># grep ^Aug /var/log/messages</td>
<td valign="top" width="52%">look up words that begin with &#8220;Aug&#8221; on file &#8216;/var/log/messages&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># grep [0-9] /var/log/messages</td>
<td valign="top" width="52%">select from file &#8216;/var/log/messages&#8217; all lines that contain numbers</td>
</tr>
<tr>
<td valign="top" width="48%"># grep Aug -R /var/log/*</td>
<td valign="top" width="52%">search string &#8220;Aug&#8221; at directory &#8216;/var/log&#8217; and below</td>
</tr>
<tr>
<td valign="top" width="48%"># groupadd [group]</td>
<td valign="top" width="52%">create a new group</td>
</tr>
<tr>
<td valign="top" width="48%"># groupdel [group]</td>
<td valign="top" width="52%">delete a group</td>
</tr>
<tr>
<td valign="top" width="48%"># groupmod -n moon sun</td>
<td valign="top" width="52%">rename a group from moon to sun</td>
</tr>
<tr>
<td valign="top" width="48%"># grpck</td>
<td valign="top" width="52%">check correct syntax and file format of &#8216;/etc/group&#8217; and groups existence</td>
</tr>
<tr>
<td valign="top" width="48%"># gunzip file1.gz</td>
<td valign="top" width="52%">decompress a file called &#8216;file1.gz&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># gzip file1</td>
<td valign="top" width="52%">compress a file called &#8216;file1&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># gzip -9 file1</td>
<td valign="top" width="52%">compress with maximum compression</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">H      Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># hdparm -i /dev/hda</td>
<td valign="top" width="52%">displays the characteristics of a hard-disk</td>
</tr>
<tr>
<td valign="top" width="48%"># hdparm -tT /dev/sda</td>
<td valign="top" width="52%">perform test reading on a hard-disk</td>
</tr>
<tr>
<td valign="top" width="48%"># head -2 file1</td>
<td valign="top" width="52%">view first two lines of a file</td>
</tr>
<tr>
<td valign="top" width="48%"># host www.example.com</td>
<td valign="top" width="52%">lookup hostname to resolve name to ip address and viceversa</td>
</tr>
<tr>
<td valign="top" width="48%"># hostname</td>
<td valign="top" width="52%">show hostname of system</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">I    Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># iconv -l</td>
<td valign="top" width="52%">lists known encodings</td>
</tr>
<tr>
<td valign="top" width="48%"># iconv -f fromEncoding -t toEncoding inputFile &gt; outputFile</td>
<td valign="top" width="52%">converting the coding of characters from one format to another</td>
</tr>
<tr>
<td valign="top" width="48%"># find . -maxdepth 1 -name *.jpg -print -exec convert</td>
<td valign="top" width="52%">batch resize files in the current directory and send them to a thumbnails directory (requires convert from Imagemagick)</td>
</tr>
<tr>
<td valign="top" width="48%"># ifconfig eth0</td>
<td valign="top" width="52%">show configuration of an ethernet network card</td>
</tr>
<tr>
<td valign="top" width="48%"># ifconfig eth0 192.168.1.1 netmask 255.255.255.0</td>
<td valign="top" width="52%">configure IP Address</td>
</tr>
<tr>
<td valign="top" width="48%"># ifconfig eth0 promisc</td>
<td valign="top" width="52%">configure &#8216;eth0&#8217; in promiscuous mode to gather packets (sniffing)</td>
</tr>
<tr>
<td valign="top" width="48%"># ifdown eth0</td>
<td valign="top" width="52%">disable an interface &#8216;eth0&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># ifup eth0</td>
<td valign="top" width="52%">activate an interface &#8216;eth0&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># init 0</td>
<td valign="top" width="52%">shutdown system(2)</td>
</tr>
<tr>
<td valign="top" width="48%"># ip link show</td>
<td valign="top" width="52%">show link status of all network interfaces</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t filter -L</td>
<td valign="top" width="52%">show all chains of filtering table</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t nat -L</td>
<td valign="top" width="52%">show all chains of nat table</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t filter -F</td>
<td valign="top" width="52%">clear all rules from filtering table</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t nat -F</td>
<td valign="top" width="52%">clear all rules from table nat</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t filter -X</td>
<td valign="top" width="52%">delete any chains created by user</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t filter -A INPUT -p tcp &#8211;dport telnet -j ACCEPT</td>
<td valign="top" width="52%">allow telnet connections to input</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t filter -A OUTPUT -p tcp &#8211;dport http -j DROP</td>
<td valign="top" width="52%">block HTTP connections to output</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t filter -A FORWARD -p tcp &#8211;dport pop3 -j ACCEPT</td>
<td valign="top" width="52%">allow POP3 connections to forward chain</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t filter -A INPUT -j LOG &#8211;log-prefix</td>
<td valign="top" width="52%">Logging on input chain</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</td>
<td valign="top" width="52%">configure a PAT (Port Address Traslation) on eth0 masking outbound packets</td>
</tr>
<tr>
<td valign="top" width="48%"># iptables -t nat -A PREROUTING -d 192.168.0.1 -p tcp -m tcp &#8211;dport 22 -j DNAT &#8211;to-destination 10.0.0.2:22</td>
<td valign="top" width="52%">redirect packets addressed to a host to another host</td>
</tr>
<tr>
<td valign="top" width="48%"># iwconfig eth1</td>
<td valign="top" width="52%">show wireless networks</td>
</tr>
<tr>
<td valign="top" width="48%"># iwlist scan</td>
<td valign="top" width="52%">wifi scanning to display the wireless connections available</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">K    Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># kill -9 process_id</td>
<td valign="top" width="52%">force closure of the process and finish it</td>
</tr>
<tr>
<td valign="top" width="48%"># kill -1 process_id</td>
<td valign="top" width="52%">force a process to reload configuration</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">L       Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># last reboot</td>
<td valign="top" width="52%">show history reboot</td>
</tr>
<tr>
<td valign="top" width="48%"># ldd /usr/bin/ssh</td>
<td valign="top" width="52%">show shared libraries required by ssh program</td>
</tr>
<tr>
<td valign="top" width="48%"># less file1</td>
<td valign="top" width="52%">similar to &#8216;more&#8217; command but which allows backward movement in the file as well as forward movement</td>
</tr>
<tr>
<td valign="top" width="48%"># ln -s file1 lnk1</td>
<td valign="top" width="52%">create a symbolic link to file or directory</td>
</tr>
<tr>
<td valign="top" width="48%"># ln file1 lnk1</td>
<td valign="top" width="52%">create a physical link to file or directory</td>
</tr>
<tr>
<td valign="top" width="48%"># locate \*.ps</td>
<td valign="top" width="52%">find files with the &#8216;.ps&#8217; extension &#8211; first run &#8216;updatedb&#8217; command</td>
</tr>
<tr>
<td valign="top" width="48%"># logout</td>
<td valign="top" width="52%">leaving session</td>
</tr>
<tr>
<td valign="top" width="48%"># ls</td>
<td valign="top" width="52%">view files of directory</td>
</tr>
<tr>
<td valign="top" width="48%"># ls -F</td>
<td valign="top" width="52%">view files of directory</td>
</tr>
<tr>
<td valign="top" width="48%"># ls -l</td>
<td valign="top" width="52%">show details of files and directory</td>
</tr>
<tr>
<td valign="top" width="48%"># ls -a</td>
<td valign="top" width="52%">show hidden files</td>
</tr>
<tr>
<td valign="top" width="48%"># ls *[0-9]*</td>
<td valign="top" width="52%">show files and directory containing numbers</td>
</tr>
<tr>
<td valign="top" width="48%"># ls -lSr |more</td>
<td valign="top" width="52%">show size of the files and directories ordered by size</td>
</tr>
<tr>
<td valign="top" width="48%"># ls -lh</td>
<td valign="top" width="52%">show permits on files</td>
</tr>
<tr>
<td valign="top" width="48%"># ls /tmp | pr -T5 -W$COLUMNS</td>
<td valign="top" width="52%">divide terminal into 5 columns</td>
</tr>
<tr>
<td valign="top" width="48%"># lsattr</td>
<td valign="top" width="52%">show specials attributes</td>
</tr>
<tr>
<td valign="top" width="48%"># lsmod</td>
<td valign="top" width="52%">display kernel loaded</td>
</tr>
<tr>
<td valign="top" width="48%"># lsof -p process_id</td>
<td valign="top" width="52%">display a list of files opened by processes</td>
</tr>
<tr>
<td valign="top" width="48%"># lsof /home/user1</td>
<td valign="top" width="52%">displays a list of open files in a given path system</td>
</tr>
<tr>
<td valign="top" width="48%"># lspci -tv</td>
<td valign="top" width="52%">display PCI devices</td>
</tr>
<tr>
<td valign="top" width="48%"># lstree</td>
<td valign="top" width="52%">show files and directories in a tree starting from root(2)</td>
</tr>
<tr>
<td valign="top" width="48%"># lsusb -tv</td>
<td valign="top" width="52%">show USB devices</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">M     Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># man ping</td>
<td valign="top" width="52%">display the on-line manual pages for example on ping command &#8211; use &#8216;-k&#8217; option to find any related commands</td>
</tr>
<tr>
<td valign="top" width="48%"># dd if=/dev/hdc | md5sum</td>
<td valign="top" width="52%">perform an md5sum on a device, like a CD</td>
</tr>
<tr>
<td valign="top" width="48%"># mii-tool eth0</td>
<td valign="top" width="52%">show link status of &#8216;eth0&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># mkbootdisk &#8211;device /dev/fd0 `uname -r`</td>
<td valign="top" width="52%">create a boot floppy</td>
</tr>
<tr>
<td valign="top" width="48%"># mkdir dir1</td>
<td valign="top" width="52%">create a directory called &#8216;dir1&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># mkdir dir1 dir2</td>
<td valign="top" width="52%">create two directories simultaneously</td>
</tr>
<tr>
<td valign="top" width="48%"># mkdir -p /tmp/dir1/dir2</td>
<td valign="top" width="52%">create a directory tree</td>
</tr>
<tr>
<td valign="top" width="48%"># mke2fs /dev/hda1</td>
<td valign="top" width="52%">create a filesystem type linux ext2 on hda1 partition</td>
</tr>
<tr>
<td valign="top" width="48%"># mke2fs -j /dev/hda1</td>
<td valign="top" width="52%">create a filesystem type linux ext3 (journal) on hda1 partition</td>
</tr>
<tr>
<td valign="top" width="48%"># mkfs /dev/hda1</td>
<td valign="top" width="52%">create a filesystem type linux on hda1 partition</td>
</tr>
<tr>
<td valign="top" width="48%"># mkfs -t vfat 32 -F /dev/hda1</td>
<td valign="top" width="52%">create a FAT32 filesystem</td>
</tr>
<tr>
<td valign="top" width="48%"># mkisofs /dev/cdrom &gt; cd.iso</td>
<td valign="top" width="52%">create an iso image of cdrom on disk</td>
</tr>
<tr>
<td valign="top" width="48%"># mkisofs /dev/cdrom | gzip &gt; cd_iso.gz</td>
<td valign="top" width="52%">create a compressed iso image of cdrom on disk</td>
</tr>
<tr>
<td valign="top" width="48%"># mkisofs -J -allow-leading-dots -R -V</td>
<td valign="top" width="52%">create an iso image of a directory</td>
</tr>
<tr>
<td valign="top" width="48%"># mkswap /dev/hda3</td>
<td valign="top" width="52%">create a swap filesystem</td>
</tr>
<tr>
<td valign="top" width="48%"># mkswap /dev/hda3</td>
<td valign="top" width="52%">create a swap filesystem</td>
</tr>
<tr>
<td valign="top" width="48%"># more file1</td>
<td valign="top" width="52%">view content of a file along</td>
</tr>
<tr>
<td valign="top" width="48%"># mount /dev/hda2 /mnt/hda2</td>
<td valign="top" width="52%">mount disk called hda2 &#8211; verify existence of the directory &#8216;/ mnt/hda2&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># mount /dev/fd0 /mnt/floppy</td>
<td valign="top" width="52%">mount a floppy disk</td>
</tr>
<tr>
<td valign="top" width="48%"># mount /dev/cdrom /mnt/cdrom</td>
<td valign="top" width="52%">mount a cdrom / dvdrom</td>
</tr>
<tr>
<td valign="top" width="48%"># mount /dev/hdc /mnt/cdrecorder</td>
<td valign="top" width="52%">mount a cdrw / dvdrom</td>
</tr>
<tr>
<td valign="top" width="48%"># mount /dev/hdb /mnt/cdrecorder</td>
<td valign="top" width="52%">mount a cdrw / dvdrom</td>
</tr>
<tr>
<td valign="top" width="48%"># mount -o loop file.iso /mnt/cdrom</td>
<td valign="top" width="52%">mount a file or iso image</td>
</tr>
<tr>
<td valign="top" width="48%"># mount -t vfat /dev/hda5 /mnt/hda5</td>
<td valign="top" width="52%">mount a Windows FAT32 file system</td>
</tr>
<tr>
<td valign="top" width="48%"># mount /dev/sda1 /mnt/usbdisk</td>
<td valign="top" width="52%">mount a usb pen-drive or flash-drive</td>
</tr>
<tr>
<td valign="top" width="48%"># mount -t smbfs -o username=user,password=pass //WinClient/share /mnt/share</td>
<td valign="top" width="52%">mount a windows network share</td>
</tr>
<tr>
<td valign="top" width="48%"># mount -o loop cd.iso /mnt/iso</td>
<td valign="top" width="52%">mount an ISO image</td>
</tr>
<tr>
<td valign="top" width="48%"># mount -t smbfs -o username=user,password=pass //WinClient/share /mnt/share</td>
<td valign="top" width="52%">mount a windows network share</td>
</tr>
<tr>
<td valign="top" width="48%"># mv dir1 new_dir</td>
<td valign="top" width="52%">rename / move a file or directory   [<a title="Get more informations about this command from the official Linux Man Page" href="http://www.linuxguide.it/command_line/linux-manpage/do.php?file=mv" target="_blank" rel="noopener">man</a>]</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">N    Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># nbtscan ip_addr</td>
<td valign="top" width="52%">netbios name resolution</td>
</tr>
<tr>
<td valign="top" width="48%"># netstat -tup</td>
<td valign="top" width="52%">show all active network connections and their PID</td>
</tr>
<tr>
<td valign="top" width="48%"># netstat -tupl</td>
<td valign="top" width="52%">show all network services listening on the system and their PID</td>
</tr>
<tr>
<td valign="top" width="48%"># netstat -rn</td>
<td valign="top" width="52%">show routing table alike &#8220;route -n&#8221;</td>
</tr>
<tr>
<td valign="top" width="48%"># newgrp &#8211; [group]</td>
<td valign="top" width="52%">log into a new group to change default group of newly created files</td>
</tr>
<tr>
<td valign="top" width="48%"># nmblookup -A ip_addr</td>
<td valign="top" width="52%">netbios name resolution</td>
</tr>
<tr>
<td valign="top" width="48%"># nslookup www.example.com</td>
<td valign="top" width="52%">lookup hostname to resolve name to ip address and viceversa</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">P   Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># pacman -S name</td>
<td valign="top" width="52%">Install package &#8216;name&#8217; with dependencies</td>
</tr>
<tr>
<td valign="top" width="48%"># pacman -R name</td>
<td valign="top" width="52%">Delete package &#8216;name&#8217; and all files of it</td>
</tr>
<tr>
<td valign="top" width="48%"># passwd</td>
<td valign="top" width="52%">change password</td>
</tr>
<tr>
<td valign="top" width="48%"># passwd user1</td>
<td valign="top" width="52%">change a user password (only by root)</td>
</tr>
<tr>
<td valign="top" width="48%"># paste file1 file2</td>
<td valign="top" width="52%">merging contents of two files for columns</td>
</tr>
<tr>
<td valign="top" width="48%"># paste -d &#8216;+&#8217; file1 file2</td>
<td valign="top" width="52%">merging contents of two files for columns with &#8216;+&#8217; delimiter on the center</td>
</tr>
<tr>
<td valign="top" width="48%"># ps -eafw</td>
<td valign="top" width="52%">displays linux tasks</td>
</tr>
<tr>
<td valign="top" width="48%"># ps -e -o pid,args &#8211;forest</td>
<td valign="top" width="52%">displays linux tasks in a hierarchical mode</td>
</tr>
<tr>
<td valign="top" width="48%"># pstree</td>
<td valign="top" width="52%">Shows a tree system processes</td>
</tr>
<tr>
<td valign="top" width="48%"># pwck</td>
<td valign="top" width="52%">check correct syntax and file format of &#8216;/etc/passwd&#8217; and users existence</td>
</tr>
<tr>
<td valign="top" width="48%"># pwd</td>
<td valign="top" width="52%">show the path of work directory</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">R      Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># rar a file1.rar test_file</td>
<td valign="top" width="52%">create an archive rar called &#8216;file1.rar&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># rar a file1.rar file1 file2 dir1</td>
<td valign="top" width="52%">compress &#8216;file1&#8217;, &#8216;file2&#8217; and &#8216;dir1&#8217; simultaneously</td>
</tr>
<tr>
<td valign="top" width="48%"># rar x file1.rar</td>
<td valign="top" width="52%">decompress rar archive</td>
</tr>
<tr>
<td valign="top" width="48%"># reboot</td>
<td valign="top" width="52%">reboot(2)</td>
</tr>
<tr>
<td valign="top" width="48%"># recode ..HTML &lt; page.txt &gt; page.html</td>
<td valign="top" width="52%">convert a text file to html</td>
</tr>
<tr>
<td valign="top" width="48%"># recode -l | more</td>
<td valign="top" width="52%">show all available formats conversion</td>
</tr>
<tr>
<td valign="top" width="48%"># restore -if /tmp/home0.bak</td>
<td valign="top" width="52%">restoring a backup interactively</td>
</tr>
<tr>
<td valign="top" width="48%"># rm -f file1</td>
<td valign="top" width="52%">delete file called &#8216;file1&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># rm -rf dir1</td>
<td valign="top" width="52%">remove a directory called &#8216;dir1&#8217; and contents recursively</td>
</tr>
<tr>
<td valign="top" width="48%"># rm -rf dir1 dir2</td>
<td valign="top" width="52%">remove two directories and their contents recursively</td>
</tr>
<tr>
<td valign="top" width="48%"># rmdir dir1</td>
<td valign="top" width="52%">delete directory called &#8216;dir1&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># route -n</td>
<td valign="top" width="52%">show routing table</td>
</tr>
<tr>
<td valign="top" width="48%"># route add -net 0/0 gw IP_Gateway</td>
<td valign="top" width="52%">configure default gateway</td>
</tr>
<tr>
<td valign="top" width="48%"># route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1</td>
<td valign="top" width="52%">configure static route to reach network &#8216;192.168.0.0/16&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># route del 0/0 gw IP_gateway</td>
<td valign="top" width="52%">remove static route</td>
</tr>
<tr>
<td valign="top" width="48%"># echo &#8220;1&#8221; &gt; /proc/sys/net/ipv4/ip_forward</td>
<td valign="top" width="52%">activate ip routing temporarily</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -q -a &#8211;qf &#8216;%10{SIZE}t%{NAME}n&#8217; | sort -k1,1n</td>
<td valign="top" width="52%">show the used space by rpm packages installed sorted by size (fedora, redhat and alike)</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -ivh [package.rpm]</td>
<td valign="top" width="52%">install a rpm package</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -ivh &#8211;nodeeps [package.rpm]</td>
<td valign="top" width="52%">install a rpm package ignoring dependencies requests   [</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -U [package.rpm]</td>
<td valign="top" width="52%">upgrade a rpm package without changing configuration files</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -F [package.rpm]</td>
<td valign="top" width="52%">upgrade a rpm package only if it is already installed</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -e [package]</td>
<td valign="top" width="52%">remove a rpm package</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -qa</td>
<td valign="top" width="52%">show all rpm packages installed on the system</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -qa | grep httpd</td>
<td valign="top" width="52%">show all rpm packages with the name &#8220;httpd&#8221;</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -qi [package]</td>
<td valign="top" width="52%">obtain information on a specific package installed   [<a title="Get more informations about this command from the official Linux Man Page" href="http://www.linuxguide.it/command_line/linux-manpage/do.php?file=rpm" target="_blank" rel="noopener">man</a>]</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -qg &#8220;System Environment/Daemons&#8221;</td>
<td valign="top" width="52%">show rpm packages of a group software</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -ql [package]</td>
<td valign="top" width="52%">show list of files provided by a rpm package installed</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -qc [package]</td>
<td valign="top" width="52%">show list of configuration files provided by a rpm package installed</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -q [package] &#8211;whatrequires</td>
<td valign="top" width="52%">show list of dependencies required for a rpm packet</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -q [package] &#8211;whatprovides</td>
<td valign="top" width="52%">show capability provided by a rpm package</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -q [package] &#8211;scripts</td>
<td valign="top" width="52%">show scripts started during installation / removal</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -q [package] &#8211;changelog</td>
<td valign="top" width="52%">show history of revisions of a rpm package</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -qf /etc/httpd/conf/httpd.conf</td>
<td valign="top" width="52%">verify which rpm package belongs to a given file</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -qp [package.rpm] -l</td>
<td valign="top" width="52%">show list of files provided by a rpm package not yet installed</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm &#8211;import /media/cdrom/RPM-GPG-KEY</td>
<td valign="top" width="52%">import public-key digital signature</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm &#8211;checksig [package.rpm]</td>
<td valign="top" width="52%">verify the integrity of a rpm package</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -qa gpg-pubkey</td>
<td valign="top" width="52%">verify integrity of all rpm packages installed</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -V [package]</td>
<td valign="top" width="52%">check file size, permissions, type, owner, group, MD5 checksum and last modification</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -Va</td>
<td valign="top" width="52%">check all rpm packages installed on the system &#8211; use with caution</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -Vp [package.rpm]</td>
<td valign="top" width="52%">verify a rpm package not yet installed</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm -ivh /usr/src/redhat/RPMS/`arch`/[package.rpm]</td>
<td valign="top" width="52%">install a package built from a rpm source</td>
</tr>
<tr>
<td valign="top" width="48%"># rpm2cpio [package.rpm] | cpio &#8211;extract &#8211;make-directories *bin*</td>
<td valign="top" width="52%">extract executable file from a rpm package</td>
</tr>
<tr>
<td valign="top" width="48%"># rpmbuild &#8211;rebuild [package.src.rpm]</td>
<td valign="top" width="52%">build a rpm package from a rpm source</td>
</tr>
<tr>
<td valign="top" width="48%"># rsync -rogpav &#8211;delete /home /tmp</td>
<td valign="top" width="52%">synchronization between directories</td>
</tr>
<tr>
<td valign="top" width="48%"># rsync -rogpav -e ssh &#8211;delete /home ip_address:/tmp</td>
<td valign="top" width="52%">rsync via SSH tunnel</td>
</tr>
<tr>
<td valign="top" width="48%"># rsync -az -e ssh &#8211;delete ip_addr:/home/public /home/local</td>
<td valign="top" width="52%">synchronize a local directory with a remote directory via ssh and compression</td>
</tr>
<tr>
<td valign="top" width="48%"># rsync -az -e ssh &#8211;delete /home/local ip_addr:/home/public</td>
<td valign="top" width="52%">synchronize a remote directory with a local directory via ssh and compression</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">S     Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># sdiff file1 file2</td>
<td valign="top" width="52%">find differences between two files and merge interactively alike &#8220;diff&#8221;</td>
</tr>
<tr>
<td valign="top" width="48%"># sed &#8216;s/string1/string2/g&#8217; example.txt</td>
<td valign="top" width="52%">replace &#8220;string1&#8221; with &#8220;string2&#8221; in example.txt</td>
</tr>
<tr>
<td valign="top" width="48%"># sed &#8216;/^$/d&#8217; example.txt</td>
<td valign="top" width="52%">remove all blank lines from example.txt</td>
</tr>
<tr>
<td valign="top" width="48%"># sed &#8216;/ *#/d; /^$/d&#8217; example.txt</td>
<td valign="top" width="52%">remove comments and blank lines from example.txt</td>
</tr>
<tr>
<td valign="top" width="48%"># sed -e &#8216;1d&#8217; exampe.txt</td>
<td valign="top" width="52%">eliminates the first line from file example.txt</td>
</tr>
<tr>
<td valign="top" width="48%"># sed -n &#8216;/string1/p&#8217;</td>
<td valign="top" width="52%">view only lines that contain the word &#8220;string1&#8221;</td>
</tr>
<tr>
<td valign="top" width="48%"># sed -e &#8216;s/ *$//&#8217; example.txt</td>
<td valign="top" width="52%">remove empty characters at the end of each row</td>
</tr>
<tr>
<td valign="top" width="48%"># sed -e &#8216;s/string1//g&#8217; example.txt</td>
<td valign="top" width="52%">remove only the word &#8220;string1&#8221; from text and leave intact all</td>
</tr>
<tr>
<td valign="top" width="48%"># sed -n &#8216;1,5p&#8217; example.txt</td>
<td valign="top" width="52%">print from 1th to 5th row of example.txt</td>
</tr>
<tr>
<td valign="top" width="48%"># sed -n &#8216;5p;5q&#8217; example.txt</td>
<td valign="top" width="52%">print row number 5 of example.txt</td>
</tr>
<tr>
<td valign="top" width="48%"># sed -e &#8216;s/00*/0/g&#8217; example.txt</td>
<td valign="top" width="52%">replace more zeros with a single zero</td>
</tr>
<tr>
<td valign="top" width="48%"># shutdown -h now</td>
<td valign="top" width="52%">shutdown system(1)</td>
</tr>
<tr>
<td valign="top" width="48%"># shutdown -h 16:30 &amp;</td>
<td valign="top" width="52%">planned shutdown of the system at 16:30</td>
</tr>
<tr>
<td valign="top" width="48%"># shutdown -c</td>
<td valign="top" width="52%">cancel a planned shutdown of the system</td>
</tr>
<tr>
<td valign="top" width="48%"># shutdown -r now</td>
<td valign="top" width="52%">reboot(1)</td>
</tr>
<tr>
<td valign="top" width="48%"># smartctl -A /dev/hda</td>
<td valign="top" width="52%">monitoring reliability of a hard-disk through SMART</td>
</tr>
<tr>
<td valign="top" width="48%"># smartctl -i /dev/hda</td>
<td valign="top" width="52%">check if SMART is active on a hard-disk</td>
</tr>
<tr>
<td valign="top" width="48%"># smbclient -L ip_addr/hostname</td>
<td valign="top" width="52%">show remote shares of a windows host</td>
</tr>
<tr>
<td valign="top" width="48%"># smbget -Rr smb://ip_addr/share</td>
<td valign="top" width="52%">like wget can download files from a host windows via smb</td>
</tr>
<tr>
<td valign="top" width="48%"># sort file1 file2</td>
<td valign="top" width="52%">sort contents of two files</td>
</tr>
<tr>
<td valign="top" width="48%"># sort file1 file2 | uniq</td>
<td valign="top" width="52%">sort contents of two files omitting lines repeated</td>
</tr>
<tr>
<td valign="top" width="48%"># sort file1 file2 | uniq -u</td>
<td valign="top" width="52%">sort contents of two files by viewing only unique line</td>
</tr>
<tr>
<td valign="top" width="48%"># sort file1 file2 | uniq -d</td>
<td valign="top" width="52%">sort contents of two files by viewing only duplicate line</td>
</tr>
<tr>
<td valign="top" width="48%"># strace -c ls &gt;/dev/null</td>
<td valign="top" width="52%">display system calls made and received by a process</td>
</tr>
<tr>
<td valign="top" width="48%"># strace -f -e open ls &gt;/dev/null</td>
<td valign="top" width="52%">display library calls</td>
</tr>
<tr>
<td valign="top" width="48%"># swapon /dev/hda3</td>
<td valign="top" width="52%">activating a new swap partition</td>
</tr>
<tr>
<td valign="top" width="48%"># swapon /dev/hda2 /dev/hdb3</td>
<td valign="top" width="52%">activate two swap partitions</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">T    Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># tac file1</td>
<td valign="top" width="52%">view the contents of a file starting from the last line</td>
</tr>
<tr>
<td valign="top" width="48%"># tail -2 file1</td>
<td valign="top" width="52%">view last two lines of a file</td>
</tr>
<tr>
<td valign="top" width="48%"># tail -f /var/log/messages</td>
<td valign="top" width="52%">view in real time what is added to a file</td>
</tr>
<tr>
<td valign="top" width="48%"># tail /var/log/dmesg</td>
<td valign="top" width="52%">show events inherent to the process of booting kernel</td>
</tr>
<tr>
<td valign="top" width="48%"># tail /var/log/messages</td>
<td valign="top" width="52%">show system events</td>
</tr>
<tr>
<td valign="top" width="48%"># tar -cvf archive.tar file1</td>
<td valign="top" width="52%">create a uncompressed tarball</td>
</tr>
<tr>
<td valign="top" width="48%"># tar -cvf archive.tar file1 file2 dir1</td>
<td valign="top" width="52%">create an archive containing &#8216;file1&#8217;, &#8216;file2&#8217; and &#8216;dir1&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># tar -tf archive.tar</td>
<td valign="top" width="52%">show contents of an archive</td>
</tr>
<tr>
<td valign="top" width="48%"># tar -xvf archive.tar</td>
<td valign="top" width="52%">extract a tarball</td>
</tr>
<tr>
<td valign="top" width="48%"># tar -xvf archive.tar -C /tmp</td>
<td valign="top" width="52%">extract a tarball into / tmp</td>
</tr>
<tr>
<td valign="top" width="48%"># tar -cvfj archive.tar.bz2 dir1</td>
<td valign="top" width="52%">create a tarball compressed into bzip2</td>
</tr>
<tr>
<td valign="top" width="48%"># tar -xvfj archive.tar.bz2</td>
<td valign="top" width="52%">decompress a compressed tar archive in bzip2</td>
</tr>
<tr>
<td valign="top" width="48%"># tar -cvfz archive.tar.gz dir1</td>
<td valign="top" width="52%">create a tarball compressed into gzip</td>
</tr>
<tr>
<td valign="top" width="48%"># tar -xvfz archive.tar.gz</td>
<td valign="top" width="52%">decompress a compressed tar archive in</td>
</tr>
<tr>
<td valign="top" width="48%"># tar -Puf backup.tar /home/user</td>
<td valign="top" width="52%">make a incremental backup of directory &#8216;/home/user&#8217;</td>
</tr>
<tr>
<td valign="top" width="48%"># ( cd /tmp/local/ &amp;&amp; tar c . ) | ssh -C user@ip_addr &#8216;cd /home/share/ &amp;&amp; tar x -p&#8217;</td>
<td valign="top" width="52%">copy content of a directory on remote directory via ssh</td>
</tr>
<tr>
<td valign="top" width="48%"># ( tar c /home ) | ssh -C user@ip_addr &#8216;cd /home/backup-home &amp;&amp; tar x -p&#8217;</td>
<td valign="top" width="52%">copy a local directory on remote directory via ssh</td>
</tr>
<tr>
<td valign="top" width="48%"># tar cf &#8211; . | (cd /tmp/backup ; tar xf &#8211; )</td>
<td valign="top" width="52%">local copy preserving permits and links from a directory to another</td>
</tr>
<tr>
<td valign="top" width="48%"># tcpdump tcp port 80</td>
<td valign="top" width="52%">show all HTTP traffic</td>
</tr>
<tr>
<td valign="top" width="48%"># telinit 0</td>
<td valign="top" width="52%">shutdown system(3)</td>
</tr>
<tr>
<td valign="top" width="48%"># top</td>
<td valign="top" width="52%">display linux tasks using most cpu</td>
</tr>
<tr>
<td valign="top" width="48%"># touch -t 0712250000 file1</td>
<td valign="top" width="52%">modify timestamp of a file or directory &#8211; (YYMMDDhhmm)</td>
</tr>
<tr>
<td valign="top" width="48%"># echo &#8216;word&#8217; | tr &#8216;[:lower:]&#8217; &#8216;[:upper:]&#8217;</td>
<td valign="top" width="52%">convert from lower case in upper case</td>
</tr>
<tr>
<td valign="top" width="48%"># tree</td>
<td valign="top" width="52%">show files and directories in a tree starting from root(1)</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">U   Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># umount /dev/hda2</td>
<td valign="top" width="52%">unmount disk called hda2 &#8211; exit from mount point &#8216;/ mnt/hda2&#8217; first</td>
</tr>
<tr>
<td valign="top" width="48%"># umount -n /mnt/hda2</td>
<td valign="top" width="52%">run umount without writing the file /etc/mtab &#8211; useful when the file is read-only or the hard disk is full</td>
</tr>
<tr>
<td valign="top" width="48%"># uname -m</td>
<td valign="top" width="52%">show architecture of machine(2)</td>
</tr>
<tr>
<td valign="top" width="48%"># uname -r</td>
<td valign="top" width="52%">show used kernel version</td>
</tr>
<tr>
<td valign="top" width="48%"># unix2dos fileunix.txt filedos.txt</td>
<td valign="top" width="52%">convert a text file format from UNIX to MSDOS</td>
</tr>
<tr>
<td valign="top" width="48%"># unrar x file1.rar</td>
<td valign="top" width="52%">decompress rar archive</td>
</tr>
<tr>
<td valign="top" width="48%"># unzip file1.zip</td>
<td valign="top" width="52%">decompress a zip archive</td>
</tr>
<tr>
<td valign="top" width="48%"># useradd -c &#8220;User Linux&#8221; -g admin -d /home/user1 -s /bin/bash user1</td>
<td valign="top" width="52%">create a new user &#8220;user1&#8221; belongs &#8220;admin&#8221; group</td>
</tr>
<tr>
<td valign="top" width="48%"># useradd user1</td>
<td valign="top" width="52%">create a new</td>
</tr>
<tr>
<td valign="top" width="48%"># userdel -r user1</td>
<td valign="top" width="52%">delete a user ( &#8216;-r&#8217; eliminates home directory)</td>
</tr>
<tr>
<td valign="top" width="48%"># usermod -c &#8220;User FTP&#8221; -g system -d /ftp/user1 -s /bin/nologin user1</td>
<td valign="top" width="52%">change user attributes as description, group and other</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">W    Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># watch -n1 &#8216;cat /proc/interrupts&#8217;</td>
<td valign="top" width="52%">display interrupts in real-time</td>
</tr>
<tr>
<td valign="top" width="48%"># wget -r www.example.com</td>
<td valign="top" width="52%">download an entire web site</td>
</tr>
<tr>
<td valign="top" width="48%"># wget -c www.example.com/file.iso</td>
<td valign="top" width="52%">download a file with the ability to stop the download and resume later</td>
</tr>
<tr>
<td valign="top" width="48%"># echo &#8216;wget -c www.example.com/files.iso&#8217; | at 09:00</td>
<td valign="top" width="52%">start a download at any given time</td>
</tr>
<tr>
<td valign="top" width="48%"># whatis &#8230;keyword</td>
<td valign="top" width="52%">displays description of what a program does</td>
</tr>
<tr>
<td valign="top" width="48%"># whereis halt</td>
<td valign="top" width="52%">show location of a binary file, source or man</td>
</tr>
<tr>
<td valign="top" width="48%"># which halt</td>
<td valign="top" width="52%">show full path to a binary / executable</td>
</tr>
<tr>
<td valign="top" width="48%"># who -a</td>
<td valign="top" width="52%">show who is logged on, and print: time of last system boot, dead processes, system login processes, active processes spawned by init, current runlevel, last system clock change</td>
</tr>
<tr>
<td valign="top" width="48%"># whois www.example.com</td>
<td valign="top" width="52%">lookup on Whois database</td>
</tr>
</tbody>
</table>
<table border="1" width="99%" cellpadding="0">
<tbody>
<tr>
<td width="48%">Y   Command</td>
<td width="52%">Description</td>
</tr>
<tr>
<td valign="top" width="48%"># yum -y install [package]</td>
<td valign="top" width="52%">download and install a rpm package</td>
</tr>
<tr>
<td valign="top" width="48%"># yum localinstall [package.rpm]</td>
<td valign="top" width="52%">That will install an RPM, and try to resolve all the dependencies for you using your repositories.</td>
</tr>
<tr>
<td valign="top" width="48%"># yum -y update</td>
<td valign="top" width="52%">update all rpm packages installed on the system</td>
</tr>
<tr>
<td valign="top" width="48%"># yum update [package]</td>
<td valign="top" width="52%">upgrade a rpm package</td>
</tr>
<tr>
<td valign="top" width="48%"># yum remove [package]</td>
<td valign="top" width="52%">remove a rpm package</td>
</tr>
<tr>
<td valign="top" width="48%"># yum list</td>
<td valign="top" width="52%">list all packages installed on the system</td>
</tr>
<tr>
<td valign="top" width="48%"># yum search [package]</td>
<td valign="top" width="52%">find a package on rpm repository</td>
</tr>
<tr>
<td valign="top" width="48%"># yum clean [package]</td>
<td valign="top" width="52%">clean up rpm cache erasing downloaded packages</td>
</tr>
<tr>
<td valign="top" width="48%"># yum clean headers</td>
<td valign="top" width="52%">remove all files headers that the system uses to resolve dependency</td>
</tr>
<tr>
<td valign="top" width="48%"># yum clean all</td>
<td valign="top" width="52%">remove from the cache packages and headers files</td>
</tr>
</tbody>
</table>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Những thủ thuật .htaccess bạn nên biết</title>
		<link>https://tuvancongnghe.net/nhung-thu-thuat-htaccess-ban-nen-biet/</link>
					<comments>https://tuvancongnghe.net/nhung-thu-thuat-htaccess-ban-nen-biet/#respond</comments>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Thu, 18 Aug 2011 08:48:38 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[rewrite url]]></category>
		<category><![CDATA[sử dụng .htaccess]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=1899</guid>

					<description><![CDATA[Dòng lệnh bắt đầu .htaccess Dòng lệnh .htaccess của bạn nên bắt đầu như sau : RewriteEngine On RewriteBase / Dòng lệnh cơ bản redirect 301 Dòng lệnh redirect 301 về cơ bản có dạng như sau trong tệp tin .htaccess : redirect 301 /old/old.htm http://www.vietprotocol.com/new.htm Dòng lệnh trên thông báo chuyển rời tệp tin [&#8230;]]]></description>
										<content:encoded><![CDATA[<h4>Dòng lệnh bắt đầu .htaccess</h4>
<p>Dòng lệnh .htaccess của bạn nên bắt đầu như sau :<br />
RewriteEngine On<br />
RewriteBase /</p>
<h4><a href="http://tuvancongnghe.net/wp-content/uploads/2011/08/htaccess.gif"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1900" title="htaccess" src="http://tuvancongnghe.net/wp-content/uploads/2011/08/htaccess.gif" alt="" width="300" height="300" srcset="https://tuvancongnghe.net/wp-content/uploads/2011/08/htaccess.gif 300w, https://tuvancongnghe.net/wp-content/uploads/2011/08/htaccess-150x150.gif 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></h4>
<h4>Dòng lệnh cơ bản redirect 301</h4>
<p>Dòng lệnh redirect 301 về cơ bản có dạng như sau trong tệp tin .htaccess :</p>
<pre>redirect 301 /old/old.htm http://www.vietprotocol.com/new.htm</pre>
<p>Dòng lệnh trên thông báo chuyển rời tệp tin <code>old.htm</code> trong thư mục <code>old</code> đến vị trí mới tại <code>http://www.vietprotocol.com/new.htm</code>.</p>
<p>Chú ý : Để bắt đầu thì bạn nên redirect 301 các trang trên cũng host, bạn chỉ nên chuyển các trang cũ đến thư mục gốc tương đối. Có thể thực hiện việc này bằng việc loại bỏ “http://www.vietprotocol.com/” mà chỉ thêm đường dẫn tương đối đến thư mục gốc.</p>
<p>Điểm mạnh nhât của việc thay đổi hàng loạt đường dẫn URL chính là mod_rewrite của Apache, đặc biệt là khi thay đổi tên miền hay thư mục<br />
hay số lượng lớn các tập tin. Chúng ta hãy tìm hiểu phần tiếp theo.</p>
<h4>Chuyển toàn bộ đến tên miền mới</h4>
<p>Nếu bạn quyết định thay đổi tên miền thì các đường dẫn trước đây từ các website bên ngoài, từ máy tìm kiếm và ngay cả các đường dẫn tuyệt đối trên website cũ đều bị thay đổi và khi bạn truy cập, các địa chỉ trên sẽ trỏ bạn đến trang báo lỗi 404 : trang không tìm thấy.</p>
<p>Vì thế nếu bạn thay đổi tên miền thì đừng để mất các liên kết quí báu và người dùng tiềm năng từ máy tìm kiếm, hãy redirect các liên kết cũ tới tên miền mới :</p>
<pre>Options +FollowSymLinks

RewriteEngine on

RewriteRule (.*) http://www.vietprotocol.com/$1 [R=301,L]</pre>
<p>Hãy thay đổi <code>www.vietprotocol.com</code> bằng tên miền mới của bạn.</p>
<h4>Redirect toàn bộ trang trong một thư mục đến mọt trang mới</h4>
<p>Giả sử như bạn không còn sử dụng thư mục “thuthuatseo” nữa và muốn chuyển tất cả các trang trong thư mục này đến trang “seoblog.php” thì hãy thêm dòng lệnh sau vào tệp tin .htaccess nằm tại thư mục gốc :</p>
<pre><code>RewriteRule ^thuthuatseo(.*)$ /seoblog.php [L,R=301]</code></pre>
<h4>Chuyển các trang động tới một trang mới</h4>
<p>Để chuyến trang web động <code>page.php?id=n</code> (với n là giá trị biến) tới một trang tĩnh mới <code>new-page.html</code> thì bạn có thể làm như sau :</p>
<pre>RewriteRule ^page.php?id=(.*)$ /new-page.htm [L,R=301]</pre>
<h4>URL với www hay không www</h4>
<p>Đôi khi các bạn bắt gặp việc website sử dụng “www” trong URL (Ví dụ như http://truongchieu.byethost8.com), trong khi có những website lại không dùng “www” này như http://aevn.fr . Nên nhớ rằng “tương ứng” với dịch vụ Web. Các bạn có thể lựa chọn riêng cho mình. Nhưng không thể chọn cả hai vì sẽ gây ra trùng lặp nội dung. sau đây là hai ví dụ, hướng dẫn bạn sủ lý triệt để vấn đề này.</p>
<h4>Trường hợp sử dụng www</h4>
<h4>Options +FollowSymLinks</h4>
<pre>RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.vietprotocol.\.net$ [NC]

RewriteRule ^(.*)$ http://www.vietprotocol.com/$1 [R=301,L]</pre>
<p>Ngoài ra còn có cách viết sau có thể áp dụng cho tất cả các host và domain, không phải edit lại :</p>
<pre>Options +FollowSymLinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.[a-z]{2,6} [NC]

RewriteCond %{HTTP_HOST} ([a-z-]+\.[a-z]{2,6})$     [NC]

RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]</pre>
<h4>Trường hợp không sử dụng www</h4>
<pre>Options +FollowSymLinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^aevn\.fr$ [NC]

RewriteRule ^(.*)$ http://aevn.fr/$1 [R=301,L]</pre>
<p>Bạn có thể thử lại với các tên miền ví dụ trên mà tớ áp dụng thành công đúng như trích dẫn.</p>
<h4>Loại bỏ Query_String</h4>
<p>Đôi khi một trang web của bạn có thể hiển thị hai đường dẫn url khác nhưng ( cùng một nội dung) ví dụ <code>seo-tools.php</code> và <code>seo-tools.php?v=mobile</code>. Tương tự như phần trên, điều này sẽ tạp ra nội dung trùng lặp trên website của bạn. Vì vậy bạn có thể loại bỏ các tham biến như sau :</p>
<pre>RewriteCond %{THE_REQUEST} ^GET\ /.*\;.*\ HTTP/

RewriteCond %{QUERY_STRING} !^$

RewriteRule .* http://www.vietprotocol.com%{REQUEST_URI}? [R=301,L]</pre>
<p>Ngoài ra nếu như tham biến QUERY_STRING không được gấn giá trị nào hết và URl kết thúc bởi biến rỗng “?”, thì bạn nên loại bỏ chúng, ví dụ “index.php?” :</p>
<pre>RewriteEngine On

RewriteBase /

RewriteCond %{QUERY_STRING} .

RewriteRule ^index.php /index.php? [L]</pre>
<h4>Chuyển phần đuôi mở rộng từ .php sang .html</h4>
<p>Việc chuyển .php sang .html có tác dụng khi bạn cần viết lại đường dẫn thân thiện với máy tìm kiếm (Friendly URL for SEO).</p>
<pre>RewriteRule ^(.*)\.html$ $1.php [R=301,L]</pre>
<h4>Chuyển gạch dưới (_) thành gạch ngang(-)</h4>
<p>Dù Google mới chấp nhận việc sử dụng gạch dưới “_” như là ký tự ngăn cách, nhưng trong thực tế người dùng vẫn quen thuộc với dấu gạch ngang “-”. Bản thân vietprotocol cũng ủng hộ dấu gạch ngang vì nó dễ nhìn hơn. Bạn có thể chuyển đổi toàn bộ dấu “_” sang “-” như sau :</p>
<pre>Options +FollowSymLinks

RewriteEngine On

RewriteBase /

RewriteRule !\.(html|php)$ - [S=4]

RewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ $1-$2-$3-$4-$5 [E=uscor:Yes]

RewriteRule ^([^_]*)_([^_]*)_([^_]*)_(.*)$ $1-$2-$3-$4 [E=uscor:Yes]

RewriteRule ^([^_]*)_([^_]*)_(.*)$ $1-$2-$3 [E=uscor:Yes]

RewriteRule ^([^_]*)_(.*)$ $1-$2 [E=uscor:Yes]

RewriteCond %{ENV:uscor} ^Yes$

RewriteRule (.*) http://www.vietprotocol.com/$1 [R=301,L]</pre>
<h4>Redirect WordPress Feeds tới Feedburner</h4>
<p>Trong bài viết sử dụng Feedbuner, các bạn có thể sử dụng plugin để quản lý Feeds RSS trên Blog WordPress. Nếu không các bạn có thể sử dụng code htaccess sau :</p>
<pre>RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_URI} ^/feed\.gif$

RewriteRule .* - [L]

RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC]

RewriteRule ^feed/?.*$ http://feeds.vietprotocol.com/quangbaweb/ [L,R=302]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]</pre>
<p>Đối với người dùng WordPress, các bạn có thể sử dụng plug-in Redirection Permanent Link để chuyến hướng các trang.</p>
<h4>Bào vệ ăn cắp tài nguyên và băng thông</h4>
<p>Đôi khi các tài liệu, film hay hình ảnh mà bạn tải trên host của mình bị người khác dùng và đăng trên website khác sẽ gây tốn băng thông, bạn có thể hạn chế việc ăn cắp bằng cách chỉ cho phép các tài nguyên trên tiếp cận trên những website bạn cho phép như sau (Nếu không sẽ trả về thư mục /feed/) :</p>
<pre>RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://(www\.)?vietprotocol.com/.*$ [NC]

RewriteRule \.(gif|jpg|swf|flv|png)$ /feed/ [R=302,L]</pre>
<h4>Ứng dụng redirect 301 trên các máy chủ khác (ngoài Apache)</h4>
<h4>IIS redirect</h4>
<p>Trong phần quản trị dịch vụ internet, nhấn phải chuột chọn tệp tin và thư mục mà bạn muốn áp dụng redirect;<br />
Chon nút “a redirection to a URL”;<br />
Chọn trang Redirection;<br />
Chon tiếp “The exact url entered above” và “A permanent redirection for this resource”;<br />
Chon “Apply”.</p>
<h4>ColdFusion Redirect</h4>
<pre>&lt;.cfheader statuscode="301" statustext="Moved permanently"&gt;

&lt;.cfheader name="Location" value="http://www.vietprotocol.com"&gt;</pre>
<h4>PHP Redirect</h4>
<h4>ASP Redirec</h4>
<pre>&lt;%@ Language=VBScript %&gt;

&lt;% Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://www.vietprotocol.com/" %&gt;</pre>
<h4>ASP .NET Redirect</h4>
<h4>JSP (Java) Redirect</h4>
<p>&lt;% response.setStatus(301); response.setHeader( &#8220;Location&#8221;, &#8220;http://www.vietprotocol.com/&#8221; ); response.setHeader( &#8220;Connection&#8221;, &#8220;close&#8221; ); %&gt;</p>
<h4>CGI PERL Redirect</h4>
<pre>$q = new CGI;

print $q-&gt;redirect("http://www.vietprotocol.com/");</pre>
<h4>Ruby on Rails Redirect</h4>
<p>def old_action<br />
headers[&#8220;Status&#8221;] = &#8220;301 Moved Permanently&#8221;<br />
redirect_to &#8220;http://www.vietprotocol.com/&#8221;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tuvancongnghe.net/nhung-thu-thuat-htaccess-ban-nen-biet/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tối ưu và bảo mật website bằng file .htaccess</title>
		<link>https://tuvancongnghe.net/toi-uu-va-bao-mat-website-bang-file-htaccess/</link>
					<comments>https://tuvancongnghe.net/toi-uu-va-bao-mat-website-bang-file-htaccess/#respond</comments>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Thu, 18 Aug 2011 06:59:21 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[sử dụng .htaccess]]></category>
		<category><![CDATA[tối ưu hóa đường dẫn]]></category>
		<category><![CDATA[tối ưu hóa website]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=1895</guid>

					<description><![CDATA[Sử dụng file .htaccess để tối ưu và bảo mật website của bạn hơn: bảo vệ các file quan trọng, giới hạn upload, chuyển hướng 301, trang lỗi tùy chỉnh, tắt liệt kê nội dung thư mục, nén nội dung&#8230; Chức năng: 1. Bảo vệ tệp tin 2. Tắt chữ ký số của web server [&#8230;]]]></description>
										<content:encoded><![CDATA[<div>
<p style="text-align: justify;"><a href="http://tuvancongnghe.net/wp-content/uploads/2011/08/htaccess.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-1896 aligncenter" title="htaccess" src="http://tuvancongnghe.net/wp-content/uploads/2011/08/htaccess.jpg" alt="" width="511" height="157" srcset="https://tuvancongnghe.net/wp-content/uploads/2011/08/htaccess.jpg 511w, https://tuvancongnghe.net/wp-content/uploads/2011/08/htaccess-300x92.jpg 300w" sizes="(max-width: 511px) 100vw, 511px" /></a>Sử dụng file .htaccess để tối ưu và bảo mật website của bạn hơn: bảo vệ các file quan trọng, giới hạn upload, chuyển hướng 301, trang lỗi tùy chỉnh, tắt liệt kê nội dung thư mục, nén nội dung&#8230;</p>
<p style="text-align: justify;">Chức năng:<br />
1. Bảo vệ tệp tin<br />
2. Tắt chữ ký số của web server<br />
3. Giới hạn upload<br />
5. Giới hạn quyền truy cập<br />
6. Trang lỗi tùy chỉnh<br />
7. Tắt liệt kê nội dung thư mục<br />
8. Chuyển hướng 301<br />
9. Chống ăn cắp băng thông như hình ảnh, video (bandwidth)<br />
10. Bật nén PHP compression (bandwidth)<br />
11. Thiết lập canonical url cho website</p>
<p style="text-align: justify;">1.Bước 1, Tạo file .htaccess.</p>
<p style="text-align: justify;">Mở Notepad hoặc phần mềm text editor. Lưu và Đặt tên file htaccess.txt.<br />
2. Nhập nội dung vào file htaccess.txt.</p>
<p style="text-align: justify;"># Bảo vệ file file htaccess</p>
<p style="text-align: justify;">&lt;files .htaccess&gt;<br />
order allow,deny<br />
deny from all<br />
&lt;/files&gt;<br />
#Tắt chữ ký số của web server</p>
<p style="text-align: justify;"># disable the server signature<br />
ServerSignature Off</p>
<p style="text-align: justify;"># limit file uploads to 10mb<br />
LimitRequestBody 10240000<br />
# Bảo vệ file cấu hình config.php</p>
<p style="text-align: justify;">&lt;files config.php&gt;<br />
order allow,deny<br />
deny from all<br />
&lt;/files&gt;<br />
# Giới hạn truy cập, chặn IP</p>
<p style="text-align: justify;">order allow,deny<br />
#deny from 000.000.000.000<br />
allow from all<br />
# Tạo Trang lỗi tùy chỉnh</p>
<p style="text-align: justify;"># custom error docs<br />
ErrorDocument 404 /notfound.php<br />
ErrorDocument 403 /forbidden.php<br />
ErrorDocument 500 /error.php<br />
# Tắt liệt kê nội dung thư mục</p>
<p style="text-align: justify;">Options All -Indexes<br />
# Chuyển hướng 301</p>
<p style="text-align: justify;">Redirect 301 /old.php <a title="http://www.yourdomain.com/new.php" href="http://www.yourdomain.com/new.php">http://www.yourdomain.com/new.php</a><br />
# Khóa tên miền tham chiếu</p>
<p style="text-align: justify;">RewriteEngine on<br />
RewriteCond %{HTTP_REFERER} digg\.com [NC]<br />
RewriteRule .* &#8211; [F]<br />
Chống ăn cắp băng thông</p>
<p style="text-align: justify;">#disable hotlinking of images with forbidden or custom image option<br />
RewriteEngine on<br />
RewriteCond %{HTTP_REFERER} !^$<br />
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]<br />
#RewriteRule \.(gif|jpg)$ &#8211; [F]<br />
#RewriteRule \.(gif|jpg)$ <a title="http://www.yourdomain.com/stealingisbad.gif" href="http://www.yourdomain.com/stealingisbad.gif">http://www.yourdomain.com/stealingisbad.gif</a> [R,L]<br />
Nén file</p>
<p style="text-align: justify;"># php compression &#8211; use with caution<br />
&lt;ifmodule mod_php4.c&gt;<br />
php_value zlib.output_compression 16386<br />
&lt;/ifmodule&gt;<br />
Tránh trùng lặp nội dung</p>
<p style="text-align: justify;"># set the canonical url<br />
RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]<br />
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]<br />
# Chống spam comments</p>
<p style="text-align: justify;">RewriteEngine On<br />
RewriteCond %{REQUEST_METHOD} POST<br />
RewriteCond %{REQUEST_URI} .comments-post\.php*<br />
RewriteCond %{HTTP_REFERER} !.*yourdomain.com.* [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^$<br />
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]</p>
<p style="text-align: justify;">3. Upload htaccess.txt lên server.</p>
<p style="text-align: justify;">Sử dụng ftp client (sử dụng ASCII mode) và đổi tên file là .htaccess.</p>
<p style="text-align: justify;">CHMOD file .htaccess sang 644.</p>
<p style="text-align: justify;">4. Kiểm tra kết quả.</p>
<p style="text-align: justify;">Apache cung cấp khả năng cấu hình qua những files truy cập siêu văn bản .htaccess., cho phép thay đổi tinh chỉnh của Apache (httpd.conf). Đảm bảo file này được ấn định một mức độ bảo mật nhất định, tránh những truy cập bất hợp pháp từ bên ngoài (xem, sửa, xóa) những tinh chỉnh này.</p>
<p style="text-align: justify;">1.Định nghĩa .htaccess:</p>
<p style="text-align: justify;">Để làm được như vậy, trước tiên bạn cần chmod file .htaccess là 644, về chmod bạn có thể tìm hiểu ở nhiều tài liệu, hoặc google.<br />
.htaccess có tác dụng trên thư mục hiện hành (nơi chưa nó) và tất cả các thư mục con. Vì vậy, muốn sử dụng .htacess để quản lí truy cập vào website của mình, đơn giản bạn chỉ việc soạn thảo một file .htaccess, và lưu nó vào thư mục root của website.</p>
<p style="text-align: justify;">2.Comment trong .htaccess:</p>
<p style="text-align: justify;">Nếu đã sử dụng và một lần sửa đổi cấu hình Apache thì chắc chắn bạn cũng biết, muốn sử dụng một module nào đó trong những available modules, bạn phải xóa dấu “#” (hash). Dấu “#” này dùng để định nghĩa một đoạn comment trong httpd.conf, và .htaccess cũng vậy. Một ví dụ:</p>
<p style="text-align: justify;">CODE<br />
#Enable Rewrite mod &lt;&lt; đây là comment, dòng này sẽ không được thực thi #trong .htaccess<br />
RewriteEngine on</p>
<p style="text-align: justify;">3.Những chú ý quan trọng:.htaccess là một công cụ rất mạnh trong việc quản lí website. Một lỗi cú pháp nhỏ (thậm chí là một khoản trắng) cũng khiến website của bạn hoạt động không được bình thường như trước. Sau khi áp dụng .htaccess, bạn nên kiểm tra một lượt website của mình xem .htaccess có gây ra lỗi ở phần, trang con nào không? Do vậy trước khi làm việc với .htaccess, bạn nên backup cẩn thận dữ liệu của mình, nếu có trục trặc xảy ra, việc khôi phục trở nên đơn giản.</p>
<p style="text-align: justify;">4.Vấn đề về performance:<br />
.htaccess cho phép bạn cấu hình mà không cần động chạm vào cấu hình chính của Apache. Tuy nhiên, về mặt hiệu năng và bảo mật, nếu có thể, bạn nên sử dụng httpd.conf hơn là sử dụng .htaccess. Cụ thể, khi được cấu hình để sử dụng .htaccess, thi Apache sẽ tìm kiếm tất cả những folder có chứa .htaccess để thực thi, và nó sẽ thực thi tất cả những file .htaccess tìm được. Do vậy, sẽ làm website của bạn trở nên ì ạch một cách không cần thiết. Nếu website của bạn là website cá nhân, hoặc ít người truy cập, thì đó là chuyện nhỏ. Nhưng nếu là một website đại chúng (báo điện tử, trang nhạc, film..) thì đây là một vấn đề rất lón. Do vậy .htaccess chỉ có tác dụng trong trường hợp bạn không có quyền cấu hình trên httpd.conf của Apache.</p>
<p style="text-align: justify;">5.Những kí tự đặc biệt sử dụng khi cấu hình .htaccess</p>
<p style="text-align: justify;">#<br />
Như đã nói ở trên, # đặt trước một dòng để định nghĩa dòng này là một đoạn comment, dòng này sẽ không được thực thi cho đến khi bạn xóa dấu “#” đi. Khi comment, bạn chỉ nên sử dụng các chữ cái, số, dấu gạch ngang hoặc gạch dưới để tránh những lỗi cú pháp không cần thiết.</p>
<p style="text-align: justify;">[F]</p>
<p style="text-align: justify;">Forbidden: Kí tự này dùng để chỉ định server sẽ trả về client trang lỗi 403 nếu truy cập vào những nơi không được phép</p>
<p style="text-align: justify;">[L]<br />
Last rule: kí tự này để ấn định rằng bước trước đã xong thì ngừng và không tiếp tục thực thi lệnh rewrite tiếp theo nữa.</p>
<p style="text-align: justify;">[N]</p>
<p style="text-align: justify;">Next: chỉ thị cho server tiếp tục rewrite cho đến khi tất cả các mục chỉ định được rewrite hoàn toàn.</p>
<p style="text-align: justify;">[G]</p>
<p style="text-align: justify;">Gone: Chỉ định server trả về client trang báo lỗi không tồn tại (no longer exit)</p>
<p style="text-align: justify;">[P]</p>
<p style="text-align: justify;">Proxy: chỉ định server điểu kiển các yêu cầu được ấn định bởi mod_proxy</p>
<p style="text-align: justify;">[C]</p>
<p style="text-align: justify;">Chain: Chỉ định server thực hiện rule hiện hành song song với rule trước đó</p>
<p style="text-align: justify;">[R]</p>
<p style="text-align: justify;">Redirect: chỉ định server đổi hướng request sang một trang khác trong trường hợp trình duyệt gởi yêu cầu duyệt một trang được sửa chữa đường dẫn (rewrite) trước đó.</p>
<p style="text-align: justify;">[NC]</p>
<p style="text-align: justify;">No-case: Chỉ định server match những kí tự tương tự nhau, ví dụ dòng lệnh sau:</p>
<p style="text-align: justify;">CODE<br />
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$ [NC]<br />
#Thì referrer là domain.com || Domain.com || DoMain.com…đều được match.</p>
<p style="text-align: justify;">[PT]</p>
<p style="text-align: justify;">Pass Through: có nghĩa là dùng kí tự để buộc &#8220;rewrite engine&#8221; ấn định bảng giá trị của uri trở thành giá trị của tên files</p>
<p style="text-align: justify;">[OR]</p>
<p style="text-align: justify;">Đây có thể gọi là một toán tử, các biểu thức được nối tiếp nhau bằng toán tử OR, trong đó biểu thức nào đúng, sẽ là quy tắc để lệnh Rewrite áp dụng.<br />
Ví dụ:</p>
<p style="text-align: justify;">CODE<br />
RewriteBase /<br />
RewriteCond %{HTTP_USER_AGENT} ^Anarchie [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^ASPSeek [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^attach [OR]<br />
RewriteRule ^.* &#8211; [F,L]</p>
<p style="text-align: justify;">Như vậy, mỗi dòng Rewritecond là một biểu thức chỉ định USER_AGENT, nếu bất cứ USER_AGENT nào match, thì RewriteRule sẽ được áp dụng, sau đó ngừng.<br />
Vì sao ngừng: Một request chỉ có một USER_AGENT, vì vậy không cần thiết phải quay trở lại kiểm tra các biểu thức còn lại, sẽ làm giảm hiệu năng phục vụ.<br />
Lời bàn:như ở trên đã nói, bạn chỉ sử dụng những chức năng này của .htaccess nếu không có quyền cấu hình trên Apache và firewall. Những chức năng lọc và chặn User agents Mod_security và Iptables đều có thể thực hiện được, vì vậy nếu đã có rule cho iptables và Mod_security, việc thêm rule trên cho .htaccess là dư thừa, và không cần thiết.</p>
<p style="text-align: justify;">[NE]</p>
<p style="text-align: justify;">No Escape: Chỉ định server xử lí các gói tin trả về mà không dùng kí tự thoát</p>
<p style="text-align: justify;">[NS]</p>
<p style="text-align: justify;">No Subrequest: Chỉ định server bỏ qua thư mục hiện hành nếu request nhắm vào thư mục con.</p>
<p style="text-align: justify;">[QSA]</p>
<p style="text-align: justify;">Append Query String: chỉ định server gắn chuỗi truy vấn vào cuối cùng của URL</p>
<p style="text-align: justify;">[S=x]</p>
<p style="text-align: justify;">Skip: Chỉ định server bỏ qua không xem xét các X rules tiếp theo nữa nếu một rule đã được thực thi.</p>
<p style="text-align: justify;">[T=MIME-type]</p>
<p style="text-align: justify;">MIME-type: Khai báo định dạng files của server</p>
<p style="text-align: justify;">[]</p>
<p style="text-align: justify;">Chỉ định các kí tự đặt đặt trong [] sẽ được match. Cụ thể [xyx] thì các request có mang theo các kí tự x, y hoặc z sẽ được match.</p>
<p style="text-align: justify;">[]+</p>
<p style="text-align: justify;">Tương tự như trên, nhưng trong trường hợp này, nếu ta đặt [xyz]+ thì tất cả các request có mang theo kí tự x, y, z hoặc x’s, y’s. z’s hoặc sự kết hợp của x,y,z với bất kì kí tự nào đều được match.<br />
[^]</p>
<p style="text-align: justify;">Ngược lại với [], các kí tự được đặt theo dạng [xyz^] sẽ không được match.</p>
<p style="text-align: justify;">[a-z]</p>
<p style="text-align: justify;">Dấu ‘-‘ đặt giữa 2 kí tự bên trong cặp dấu [] sẽ match tất cả các kí tự nằm trong khoảng từ kí tự đầu đến kí tự cuối. Ví dụ [a-bA-B] sẽ match tất cả các kí tự thường vào in hoa abcd và ABCD.</p>
<p style="text-align: justify;">a{n}</p>
<p style="text-align: justify;">Sẽ chỉ định chính xác n kí tự a được match. Ví dụ a{3} thì 3 kí tự a sẽ được match.</p>
<p style="text-align: justify;">a{n,}</p>
<p style="text-align: justify;">Tương tự như trên, nhưng trong trường hợp này sẽ match các kí tự a từ na trở lên.</p>
<p style="text-align: justify;">a{n,m}</p>
<p style="text-align: justify;">Chỉ định một khoảng chính xác các kí tự (m-n)a sẽ được match.</p>
<p style="text-align: justify;">()</p>
<p style="text-align: justify;">Nhóm các phương thức truyền dữ liệu (method). VD:</p>
<p style="text-align: justify;">CODE<br />
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC,OR]<br />
Các request bắt đầu (^) HEAD, TRACE, DELETE hoặc TRACK sẽ được match.</p>
<p style="text-align: justify;">^</p>
<p style="text-align: justify;">Bắt đầu bằng (xem ví dụ ở trên).<br />
$</p>
<p style="text-align: justify;">Kết thúc bằng ( .*$: kết thúc bằng bất cứ gì)<br />
?</p>
<p style="text-align: justify;">Thường dùng chung với (), như trong trường hợp test(ti)? thì test hoặc ti sẽ được match.</p>
<p style="text-align: justify;">!</p>
<p style="text-align: justify;">Phủ định. VD: “!string” sẽ match tất cả các kí tự, ngoại trừ string<br />
&#8211;</p>
<p style="text-align: justify;">Loại đi một chức năng, hoặc một rule đang thực thi nào đó. VD:<br />
CODE<br />
# không cho xem chỉ mục trong một folder nào đó<br />
Options All –Indexes</p>
<p style="text-align: justify;">+</p>
<p style="text-align: justify;">Chỉ định 1 hoặc nhiều kí tự cho trước sẽ được match. Hoặc thêm một chức năng nào đó VD: G+ sẽ match tất cả các kí tự G, Gs, Gx, G..</p>
<p style="text-align: justify;">*</p>
<p style="text-align: justify;">Tất cả đều được match. Ví dụ:<br />
CODE<br />
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$</p>
<p style="text-align: justify;">Thì tất cả request files không mở đầu bằng _http://domain.com đều được match.</p>
<p style="text-align: justify;">|</p>
<p style="text-align: justify;">Hoặc. Ví dụ x|y thì hoặc x hoặc y sẽ được match.</p>
<p style="text-align: justify;">\</p>
<p style="text-align: justify;">Kí tự thoát. VD: www\.domainname\.com Chỉ có www được match, chứ không có wwww hoặc wwwww, domainname chứ không có domainnames hoặc domainnamex…<br />
-d</p>
<p style="text-align: justify;">Kiểm tra thư mục có tồn tại hay không?<br />
-f</p>
<p style="text-align: justify;">Kiểm tra file có tồn tại hay không</p>
<p style="text-align: justify;">-s</p>
<p style="text-align: justify;">Kiểm tra giá trị của file có khác 0 hay không?</p>
<p style="text-align: justify;">6. Mã chuyển hướng trang báo lỗi</p>
<p style="text-align: justify;">&#8211; 401 &#8211; Authorization Required : Lỗi chưa được xác thực user và password<br />
&#8211; 400 &#8211; Bad request : Lỗi truy cập không hợp lệ, do server không chấp nhận request, hoặc request thiếu một số yêu cầu nào đó.<br />
&#8211; 403 &#8211; Forbidden : Lỗi truy cập vào trang bị cấm<br />
&#8211; 500 &#8211; Internal Server Error : Lỗi do server<br />
&#8211; 404 &#8211; Wrong page : Lỗi truy cập vào trang không tồn tại<br />
-301 &#8211; Moved Permanently: 302 &#8211; Moved Temporarily: Lỗi truy cập vào trang đã bị di chuyển.</p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://tuvancongnghe.net/toi-uu-va-bao-mat-website-bang-file-htaccess/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Cách Rewrite URL trong PHP – Tạo đường dẫn thân thiện cho website</title>
		<link>https://tuvancongnghe.net/cach-rewrite-url-trong-php-tao-duong-dan-than-thien-cho-website/</link>
					<comments>https://tuvancongnghe.net/cach-rewrite-url-trong-php-tao-duong-dan-than-thien-cho-website/#respond</comments>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Thu, 18 Aug 2011 04:23:55 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[rewrite url]]></category>
		<category><![CDATA[tối ưu hóa đường dẫn]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=1892</guid>

					<description><![CDATA[Cách Rewrite URL trong PHP Nhiều bạn thiết kế website hỏi làm sao tạo được các đường dẫn đẹp (URL Rewrite). Trước tiên chúng ta tìm hiểu cơ chế rewite: Rewrite Engine là một phần dịch vụ của Webserver được dùng để thay đổi URL(đường dẫn trên trình duyệt) sang một dạng khác với nhiều [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><span style="color: red;"> <strong>Cách Rewrite URL trong PHP </strong></span></p>
<p><a href="http://tuvancongnghe.net/wp-content/uploads/2011/08/url-rewriting.png"><img loading="lazy" decoding="async" class="alignleft size-medium wp-image-1893" title="url-rewriting" src="http://tuvancongnghe.net/wp-content/uploads/2011/08/url-rewriting-300x121.png" alt="" width="300" height="121" srcset="https://tuvancongnghe.net/wp-content/uploads/2011/08/url-rewriting-300x121.png 300w, https://tuvancongnghe.net/wp-content/uploads/2011/08/url-rewriting.png 317w" sizes="(max-width: 300px) 100vw, 300px" /></a>Nhiều bạn thiết kế website hỏi làm sao tạo được các đường dẫn đẹp (URL Rewrite). Trước tiên chúng ta tìm hiểu cơ chế rewite: Rewrite Engine là một phần dịch vụ của Webserver được dùng để thay đổi URL(đường dẫn trên trình duyệt) sang một dạng khác với nhiều mục đích khác nhau.</p>
<p>Kỹ thuật được nói đến là URL rewriting và nó đem lại những tiện lợi sau:- Làm cho URL trở nên thân thiện với người dùng cũng như dễ dàng với các Search Engine (bộ máy tìm kiếm)- Tránh lộ các đường link quan trọng- Tránh lộ các công việc bên trong trước người dùng</p>
<p>Bản chất của việc rewrite này các bạn có thể hình dung như sau: khi bạn gõ 1 đường link lên trình duyệt như sau: http://vidu.com/news/2007/13/01 thì đây là đường dẫn ảo, và khi request đến Webserver nó sẽ đổi lại thành đường dẫn thật như sau: http://vidu.com/index.php?mod=news&amp;y&#8230;ay=13&amp;month=01 &lt;&lt; có thể là như thế này vì có nhiều cách rewrite.</p>
<p>Đối với Server Apache: để thực hiện được URL Rewriting bạn làm các bước sau:</p>
<p>1. Kích hoạt mod mod_rewrite có sẵn trong Apache bẳng cách sửa trong file httpd.conf, bạn Find đến dòng chưa rewrite_module rồi bỏ dấu # (nếu có) ở đầu đi. Sau đó restart Apache. Nếu bạn dùng các host trên internet thì có thể đã có sẵn rồi.</p>
<p>2. Tạo 1 file .htacces có nội dung như sau:<br />
Đầu tiên bật Rewrite Engine:</p>
<div>
<div>PHP Code:</div>
<div>
<p><code> <span style="color: #008000;"><em>RewriteEngine on<br />
Options +FollowSymlinks<br />
RewriteBase </em>/ </span><br />
</code></p>
</div>
</div>
<p>Tiếp đến là viết cú pháp RewriteRule:</p>
<div>
<div>PHP Code:</div>
<div>
<p><code> <em><span style="color: #008000;">RewriteRule ^Virtual_Path Real_Path </span></em><br />
</code></p>
</div>
</div>
<p>Ví dụ:</p>
<div>
<div>PHP Code:</div>
<div>
<p><code> <em><span style="color: #008000;">RewriteRule ^topic_([0-9]*).html index.php?topic=$1 </span></em><br />
</code></p>
</div>
</div>
<p>ví dụ: topic_1.html thành index.php?topic=1</p>
<div>
<div>PHP Code:</div>
<div>
<p><code> <em><span style="color: #008000;">RewriteRule ^article/([0-9]*)/page/([0-9]*) index.php?article=$1&amp;page=$2 </span></em><br />
</code></p>
</div>
</div>
<p>ví dụ: article/1/page/2 thành index.php?article=1&amp;page=2</p>
<p>Cú pháp để viết các Rule này giống như cách viết của biểu thức chính quy Regular Expression. ví dụ như sau:</p>
<p>(.*) nhận tất cả các giá trị.<br />
([0-9]*) chỉ nhận các giá trị là số, từ 0-9.<br />
([a-zA-Z]*) chỉ nhận các giá trị là chữ cái, từ a-z và A-Z.</p>
<p>3. Sau khi tạo được file htaccess bạn copy nó vào thư mục gốc của web của bạn là có thể chạy được.</p>
<p>Đối với Server IIS: các bạn download gói cần thiết về để có thể thực hiện được việc rewrite, các bạn có thể download từ 1 số trang sau:</p>
<p><a href="http://www.micronovae.com/ModRewrite/ModRewrite.html" target="_blank">http://www.micronovae.com/ModRewrite/ModRewrite.html</a><br />
<a href="http://www.qwerksoft.com/products/iisrewrite/" target="_blank">http://www.qwerksoft.com/products/iisrewrite/</a><br />
<a href="http://www.isapirewrite.com/" target="_blank">http://www.isapirewrite.com/</a><br />
<a href="http://www.motobit.com/help/url-replacer-rewriter/iis-mod-rewrite.asp" target="_blank">http://www.motobit.com/help/url-repl&#8230;od-rewrite.asp</a></p>
<p>Ngoài việc sử dụng mod url_rewrite như trên thì nếu host của bạn ko có kích hoạt mod này hoặc bạn ko có quyền để cấu hình nó như trên. Để đơn giản các bạn có thể tạo ra những cách khác nhau để làm cho URL trở nên đẹp và thân thiện hơn. Dưới đây là 1 số cách khác nhau.</p>
<p>c1 dạng như sau: http://vidu.com/index.php/news/2007/13/01 &lt;&lt; Trông rất giống với kiểu rewrite ở trên nhưng nó khác ở chỗ nó là đường dẫn thật còn url rewrite là đường dẫn ảo. Đường dân này hiểu như là 1 request đến file index.php với Query String (Xâu truy vấn) là /news/2007/13/01, các bạn tách xâu này ra rồi sử dụng theo mục đích của mình. Cách này đang được trang web 24h.com.vn sử dụng.</p>
<p>c2 dạng như sau: http://vidu.com/index.php/news_2007_13_01.html &lt;&lt; Gần giống cách 1 ở trên nhưng đường dẫn khác thân thiện với đuôi html, dễ dàng cho các search engine (máy tìm kiếm như Google, Yahoo) tìm kiếm nội dung.</p>
<p>c3 có thể viết như sau: http://vidu.com/index.php?q=news/2007/13/01 &lt;&lt; cũng gần giống cách 1 nhưng nó rõ ràng hơn, nó được dùng trong FrameWork Drupal của PHP.</p>
<p>Và có thể có nhiều cách khác nhau các bạn có thể tự nghĩ ra. Hoặc có thể dùng cách mã hoá xâu truy vấn chẳng hạn.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tuvancongnghe.net/cach-rewrite-url-trong-php-tao-duong-dan-than-thien-cho-website/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Nguyên nhân máy tính chạy chậm</title>
		<link>https://tuvancongnghe.net/nguyen-nhan-may-tinh-chay-cham/</link>
					<comments>https://tuvancongnghe.net/nguyen-nhan-may-tinh-chay-cham/#respond</comments>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Thu, 19 May 2011 23:33:05 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[lỗi máy tính]]></category>
		<category><![CDATA[máy tính chạy chậm]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=1648</guid>

					<description><![CDATA[Có một thực tế mà hầu như người sử dụng máy tính nào cũng gặp phải: sau một thời gian đưa vào sử dụng, máy tính sẽ trở nên ì ạch hơn lúc đầu rất nhiều. Nhiều lý do để dẫn đến tình trạng trên và đây là một số những nguyên nhân thường gặp. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Có một thực tế mà hầu như người sử dụng máy tính nào cũng gặp phải: sau một thời gian đưa vào sử dụng, máy tính sẽ trở nên ì ạch hơn lúc đầu rất nhiều. Nhiều lý do để dẫn đến tình trạng trên và đây là một số những nguyên nhân thường gặp.<br />
<a href="http://tuvancongnghe.net/wp-content/uploads/2011/05/slow-computer.jpg"><img loading="lazy" decoding="async" class="aligncenter wp-image-1649 size-full" title="slow-computer" src="http://tuvancongnghe.net/wp-content/uploads/2011/05/slow-computer.jpg" width="380" height="250" srcset="https://tuvancongnghe.net/wp-content/uploads/2011/05/slow-computer.jpg 380w, https://tuvancongnghe.net/wp-content/uploads/2011/05/slow-computer-300x197.jpg 300w" sizes="(max-width: 380px) 100vw, 380px" /></a><br />
<strong>1. Máy tính cài chương trình diệt virus quá “nặng” </strong><br />
Dễ nhận thấy, chương trình diệt virus càng hiệu quả thì lại càng can thiệp sâu vào hệ thống máy tính. Điều đó dẫn đến việc tốc độ xử lý của máy bị giảm đi đáng kể sau khi được bảo vệ bởi những chương trình như Norton Anti Virus hay Mcafee… Biện pháp xử lý lúc này tất nhiên không phải là gỡ bỏ chúng vì như vậy chẳng khác nào mở cửa cho các loại sâu hay virus thâm nhập vào máy tính. Hướng giải quyết đơn giản là nếu như cấu hình của máy tính bạn không thuộc vào dạng hàng “khủng” như Pentium IV hay Duo Core … thì nên chuyển sang chương trình bảo vệ nhẹ hơn, phù hợp với cấu hình máy tính cá nhân. Bit Defender hay Kasperky là lời khuyên đưa ra ở đây.<br />
<strong>2. Quá nhiều chương trình được kích hoạt khi khởi động máy</strong></p>
<p>Nhà sản xuất phần mềm nào cũng đều muốn chương trình mình được sử dụng nhiều nhất. Điều đó dẫn đến việc hầu hết các chương trình sau khi được cài đặt đều tự cho mình quyền được xuất hiện ngay sau khi Windows khởi động. Chính việc đó làm cho tài nguyên máy bị chiếm dụng vô cùng lãng phí, trong khi chủ nhân của máy chưa chắc đã có nhu cầu dùng đến những chương trình này. Vì thế, khi install một software, bạn nên để ý đến những câu hỏi như: “Bạn có muốn chương trình này được chạy khi Windows khởi động không?”. Càng ít chương trình được chạy khi khởi động, máy tính của bạn sẽ càng chạy nhanh. Nếu phần mềm đã cài không cho phép chỉnh sửa việc này, chạy Run, gõ msconfig, chọn Start up và tích bỏ chương trình không cần xuất hiện khi khởi động máy.</p>
<p><strong>3. Gỡ bỏ các phần mềm không theo đúng quy trình</strong></p>
<p>Nếu bạn cài đặt một chương trình bằng việc Install, tất nhiên khi không còn cần dùng đến phần mềm đó, bạn phải sử dụng chức năng Uninstall để gỡ bỏ. Thế nhưng rất nhiều nhà sản xuất lại chỉ để ý đến việc làm sao cho chương trình của mình chạy được trên máy tính, mà “quên mất” chức năng ngược lại khiến nhiều người lúng túng khi muốn xóa. Ngay cả khi bạn xóa hết toàn bộ các file chương trình đó trong Program Files, vẫn còn rất nhiều thông số hệ thống “mắc” lại trong registry của máy, làm cho máy tính chạy chậm đi. Hướng giải quyết ở đây là: vào Control Panel/Add or Remove Program để gỡ bỏ chương trình cần uninstall.</p>
<p><strong>4. Máy sinh ra quá nhiều “rác” cùng quá trình sử dụng</strong></p>
<p>Cùng với thời gian, máy tính của bạn sẽ trở nên ì ạch do phải chứa khá nhiều những file như temporary files, cookies hay saved passwords…Tất nhiên những file này đều được Microsoft tính đến là có tác dụng, tuy nhiên khi mà dung lượng của chúng trở nên quá lớn thì cũng nên dọn dẹp một chút. Bạn vào Tools trong Internet Explorer, chọn Internet Options/Browsing history, ấn Delete.</p>
<p><strong>5. Ổ cứng bị phân mảnh</strong></p>
<p>Khi liên tục copy, xóa các file trên ổ cứng, ổ cứng sẽ có hiện tượng bị phân mảnh, làm giảm tốc độ đọc các chương trình của máy tính. Thông thường sau khoảng vài tháng đưa vào sử dụng, bạn nên sử dụng chức năng chống phân mảnh mà Microsoft cung cấp để tăng tốc độ đọc ổ. Click chuột phải vào ổ cần thao tác, chọn Properties/Tools/Defragmentation. Mặc dù việc xử lý này sẽ tương đối mất thời gian tùy thuộc vào dung lượng ổ cứng và số các chương trình trên ổ. Sau khi quá trình Defragmentation được hoàn tất, bạn sẽ cảm nhận rõ sự thay đổi về tốc độ CPU.</p>
<p><strong>6. Bộ nhớ đệm không hợp lý</strong></p>
<p>Khi RAM máy tính bị tận dụng hết công suất, máy tính sẽ viện đến một công cụ hỗ trợ rất đắc lực là bộ nhớ ảo (Virtual Memory). Tuy nhiên nếu cài đặt không hợp lý, bạn sẽ thường xuyên gặp phải thông báo: “Virtual Memory Too Low”. Sửa bộ nhớ ảo bằng cách click chuột phải vào My Computer/Properties chọn Advanced &gt; Performance &gt; Settings, chọn tiếp Advanced/Virtual Memory/Change. Tại đây bạn chọn Initial Size và Maximum size cho hợp lý với lượng RAM máy tính và dung lượng ổ cứng. Thông thường nếu RAM là 512 MB và dung lượng ổ cứng còn trống là khoảng vài GB thì nên để Initial Size = Maximum size = 1000.<br />
<strong>7. Hệ thống tản nhiệt của máy hoạt động không hiểu quả</strong></p>
<p>Một khi nhiệt độ CPU quá nóng thì máy tính của bạn sẽ chạy rất chậm chạp và dễ bị treo cho dù CPU của bạn thuộc dạng khủng .<br />
Vì thế bạn nên định kỳ kiểm tra xem hệ thống tản nhiệt cho CPU , Card màn hình có hoạt động tốt không, nếu gặp vấn đề hãy tìm cách khắc phục ngay.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tuvancongnghe.net/nguyen-nhan-may-tinh-chay-cham/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Dịch vụ SEO: thủ thuật xây dựng liên kết cho các website mới</title>
		<link>https://tuvancongnghe.net/dich-vu-seo-thu-thuat-xay-dung-lien-ket-cho-cac-website-moi/</link>
					<comments>https://tuvancongnghe.net/dich-vu-seo-thu-thuat-xay-dung-lien-ket-cho-cac-website-moi/#respond</comments>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Tue, 17 May 2011 10:37:47 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[Dịch vụ Quảng bá Website]]></category>
		<category><![CDATA[dịch vụ seo]]></category>
		<category><![CDATA[liên kết website]]></category>
		<category><![CDATA[thủ thuật seo]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=1589</guid>

					<description><![CDATA[Các Websites mới cần thu hút thêm nhiều links để được chú ý bởi các công cụ tìm kiếm. Những kết nối đến một Website mới sẽ giúp Website này được index bởi các search engine, qua đó giúp tăng pagerank cho nó từ vị trí thấp ban đầu đến vị trí cao hơn. Sau [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Các Websites mới cần thu hút thêm nhiều links để được chú ý bởi các công cụ tìm kiếm. Những kết nối đến một Website mới sẽ giúp Website này được index bởi các search engine, qua đó giúp tăng pagerank cho nó từ vị trí thấp ban đầu đến vị trí cao hơn.</p>
<figure id="attachment_1590" aria-describedby="caption-attachment-1590" style="width: 350px" class="wp-caption aligncenter"><a href="http://tuvancongnghe.net/wp-content/uploads/2011/05/link-building2.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-1590" title="link-building2" src="http://tuvancongnghe.net/wp-content/uploads/2011/05/link-building2.jpg" alt="" width="350" height="330" srcset="https://tuvancongnghe.net/wp-content/uploads/2011/05/link-building2.jpg 350w, https://tuvancongnghe.net/wp-content/uploads/2011/05/link-building2-300x282.jpg 300w" sizes="(max-width: 350px) 100vw, 350px" /></a><figcaption id="caption-attachment-1590" class="wp-caption-text">Liên kết website giúp website bạn có thứ hạng tốt hơn</figcaption></figure>
<p>Sau đây là những thủ thuật xây dựng liên kết được chọn lựa, đảm bảo sẽ nhận được những links miễn phí từ các Websites đã phát triển rồi. Các thủ thuật này hoàn toàn khác so với các chiến lược phát triển Websites hướng nội dung – là chiến lược nhằm dần dần thu hút những editorial links. Những thủ thuật xây dựng link này tập trung nhiều hơn vào việc đặt các links hướng mục tiêu hay còn gọi là “chèn link”.<br />
<strong>1. Submit trang của bạn vào các Web Directories:</strong> Đây là một quá trình đơn điệu vì hầu hết ta phải submit nó bằng tay, nhưng nếu bạn dành thời gian vào nó, trang của bạn có thể thu hút được hàng trăm backlinks. Bạn có thể sử dụng danh sách các Web directories tại đây.</p>
<p><strong>2. Submit những thông cáo báo chí tới những trang PR:</strong> Một thông cáo báo chí cơ bản về việc khai trương trai Web của bạn nên được submit tới nhiều Websites PR, những Websites này sẽ gửi thông cáo báo chí của bạn tới nhiều kênh tin tức trực tuyến khác nhau. Đây là một cách rất tốt để thu hút các free links. Trên thế giới có 2 trang PR khá phổ biến là PRWeb và PRLeap.</p>
<p><strong>3. Tạo các kết nối qua lại với những trang tương đồng:</strong> Việc tạo cho những trang mới dần có độ phù hợp cao là rất quan trọng, nó không chỉ giúp bạn thu hút link mà còn cả traffic. Không ai phủ nhận sự hữu ích của việc liên kết qua lại (reciprocal links) nhưng bạn cũng không nên lạm dụng nó. Bạn có thể tìm các link đối tác bằng cách gửi mail trực tiếp đến họ hoặc tìm trên các diễn đàn.</p>
<p><strong>4. Tạo những trang Squidoo Lenses:</strong> Bạn có thể tạo một Squidoo lens dễ dàng. Vào trang chủ của Squidoo lens và làm theo các bước hướng dẫn của nó, bạn chỉ mất khoảng 15 phút để tạo một Squidoo lens. Với trang này, bạn có thể chèn hàng loạt các anchor text links cho Website của bạn cùng với các nội dung phong phú. Hubpages là một trang tương tự khác bạn có thể sử dụng.<br />
5. Đăng ký tiêu đề. Tạo một tiêu đề ngắn trên những topic hấp dẫn của bạn và đăng ký nó với các thư mục tiêu đề cho một backlink và một vài traffic. Bạn có thể thu hút được nhiều links hơn nếu tiêu đề của bạn được đăng trên các Websites khác. Sau đây là một loạt danh sách các thư mục tiêu đề được xếp hạng bởi Alexa và PageRank.</p>
<p><strong>6. Tạo các profiles thông tin xã hội, social Media Profiles:</strong> Có rất nhiều mạng xã hội trực tuyến cho phép bạn chèn 1 kết nối tới Website của bạn trên một trang profile. Hãy đăng ký tài khoản ở một vài trang như thế, tốt nhất là chọn tên và avatar trùng với tên thương hiệu của Website. Điều này có thể rất hữu ích khi bạn quyết định phát triển trang của bạn thông qua mạng xã hội trong tương lai.</p>
<p><strong>7. Sử dụng SOCIAL BOOKMARKING:</strong> Chắc chắn những Websites xã hội như Netscape hay Digg sẽ thường xuyên được các công cụ tìm kiếm crawl, và những kết nối của chúng sẽ dễ dàng được index.</p>
<p><strong>8. Chữ ký diễn đàn:</strong> Đăng ký tài khoản tại một số diễn đàn và tạo chữ ký cho tài khoản đó, chữ ký này phải được liên kết đến trang chủ hay các trang bên trong Website của bạn. Sau đó bạn nên tạo những chủ đề hấp dẫn và đóng góp viết bài, thảo luận trên các diễn đàn đó. Sau khi bạn đã tạo được ấn tượng, các thành viên khác sẽ biết đến chữ ký và quan trong hơn là trang Web của bạn.</p>
<p><strong>9. Tạo một giao diện hay Widget tốt:</strong> Bạn nên thuê một nhà thiết kế thực thụ đến tư vấn và thiết kế cho bạn một giao diện liên quan tới một mạng xã hội cụ thể nào đó hay một trang phổ biến. Điều này giúp bạn thu hút được những link chất lượng đến trang của bạn.</p>
<p><strong>10. Lập các blogs nền những nền blog khác:</strong> Ngoài việc sử dụng blog hiện tại của bạn, bạn nên lập thêm các blog trên các mạng blog khác như WordPress.com, Blogger và Xanga. Link chúng tới những trang cụ thể trên Website của bạn.</p>
<p><strong>11. Viết comment trên các blog khác:</strong> Đầu tiên hãy thực hiện comment trên những trang phổ biến và những trang có liên quan đến Website của bạn. Đừng comment theo kiểu spam để thu hút link mà nên tập trung xây dựng các mối quan hệ với những blogger khác. Hãy viết những comment tốt, cố gắng tránh lạm dụng những từ khoá hay chữ ký link đến Website của bạn. Sau 10 bước trên, vấn đề của bạn bây giờ là tạo thương hiệu chứ không phải là spam.</p>
<p><strong>12. Đăng bài viết lên các blog khác:</strong> Cũng giống như phần tiêu đề và thông cáo báo chí, bạn nên đăng các bài viết chất lượng của Website bạn lên các blog khác (chú ý phải tạo kết nối). Đây là cách rất tốt để thu hút các relevant link và traffic.</p>
<p><strong>13. Tổ chức các cuộc thi:</strong> Một số Websites thường đưa ra các cuộc thi đấu giá để thu hút những anchor text link từ các bloggers. Ví dụ như cuộc thi iPhone giveaway trên trang của Gary Lee.</p>
<p><strong>14. Các dự án hỗ trợ hợp tác:</strong> Bạn nên xây dựng những mối quan hệ hỗ trợ, hợp tác với những đối tác tiềm năng. Trao đổi liên kết với những trang của họ sẽ giúp bạn có được một lượng backlink nhất định.</p>
<p><strong>15. Chia sẻ kinh nghiệm:</strong> Nếu thực hiện tốt bước này, Website của bạn sẽ sớm đạt được 1 vị thế mới. Để ứng dụng tốt bước này, bạn phải là người có những kỹ năng nhất định như thiết kế Web, viết quảng cáo, dịch thuật hay <a href="http://thuvienwebmaster.com/SEO-SEM">SEO</a>. Hãy chia sẻ kinh nghiệm, những hiểu biết của bạn đối với những Website khác, đưa ra các lời khuyên giúp tối ưu hoá những Website đó,… Điều này sẽ giúp bạn có được niềm tin, thương hiệu từ các webmaster khác.</p>
<p>Danh sách những thủ thuật trên chỉ là một vài phương pháp tôi dùng để xây dựng liên kết cho các Websites mới. Sau khi đạt được một số lượng link nhất định, tôi tập trung vào phát triển nội dung Website với hy vọng sẽ tăng nhanh chóng lượng người đọc.</p>
<p style="text-align: right;"><em><strong>Ng</strong></em><em><strong>uồn Vnpower</strong></em></p>
]]></content:encoded>
					
					<wfw:commentRss>https://tuvancongnghe.net/dich-vu-seo-thu-thuat-xay-dung-lien-ket-cho-cac-website-moi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tìm hiểu về hệ điều hành Linux</title>
		<link>https://tuvancongnghe.net/tim-hieu-ve-he-dieu-hanh-linux/</link>
					<comments>https://tuvancongnghe.net/tim-hieu-ve-he-dieu-hanh-linux/#respond</comments>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Fri, 06 May 2011 09:45:45 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[hệ điều hành linux]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=1553</guid>

					<description><![CDATA[1. Linux là gì? Linux là hệ điều hành. Về mặt nguyên tắc hệ điều hành cũng là một software; nhưng đây là một software đặc biệt – được dùng để quản lý, điều phối các tài nguyên (resource) của hệ thống (bao gồm cả hardware và các software khác). Linux còn được gọi là [&#8230;]]]></description>
										<content:encoded><![CDATA[<div>
<p><strong>1. Linux là gì?</strong></p>
<p>Linux là hệ điều hành. Về mặt nguyên tắc hệ điều hành cũng là một software; nhưng đây là một software đặc biệt – được dùng để quản lý, điều phối các tài nguyên (resource) của hệ thống (bao gồm cả hardware và các software khác). Linux còn được gọi là Open Source Unix (OSU), Unix-like Kernel, clone of the UNIX operating system.</p>
<p>Linux do Linus Torvalds, một sinh viên tại trường Đại Học ở Helsinki (Phần Lan) phát triển dựa trên hệ điều hành Minix, một hệ điều hành có cấu trúc tương tự Unix với các chức năng tối thiểu được dùng trong dạy học.</p>
<p>Hiện nay, Linux là một hệ điều hành với mã nguồn mở (Open Source) và miễn phí (free) dưới bản quyền của tổ chức GNU (Gnu’s Not Unix).</p>
<p>Khởi đầu, Linux được thiết kế để hoạt động trên nền tảng của kiến trúc i386 Intel với khả năng đa tác vụ (multitasking). Tuy nhiên ngày nay, Linux đã có các phiên bản trên các họ chip khác chẳng hạn như chip Alpha.</p>
<p>Linux có nguyên lý hoạt động tương tự hệ điều hành Unix (Unix-like). Mặc dù Linux không phải là Unix nhưng người ta vẫn xem Linux như là phiên bản Unix trên PC (PC version of Unix OS).</p>
<p>Do là Unix-like; Linux có đầy đủ tất cả các đặc tính của Unix (fully functional). Ngoài ra nó còn hỗ trợ thêm một số tính năng mà trên Unix không có,<br />
như long file name (tên file có ký tự space “ ”).</p>
<p>Hiện tại có nhiều hãng, nhiều tổ chức, nhiều nhóm khác nhau cùng phát triển Linux. Tất cả các phiên bản (release) Linux đều có chung phần kernel (phần nhân của hệ điều hành) và hầu hết các tính năng đặc trưng, tuy nhiên các tool (công cụ) và utility (tiện ích) có đôi chút dị biệt.</p>
<p>Có rất nhiều các ứng dụng cho Linux, tuy nhiên hầu hết các ứng dụng cho Linux hiện có đều là các ứng dụng mang tính chuyên dụng. Để đưa Linux vào từng gia đình, các tổ chức, các hãng đang cố gắng phát triển các ứng dụng mang tính phổ cập trên Linux chẳng hạn hãng SUN đưa ra phiên bản Star Office tương tự như MS Office – và cũng tương thích với MS Office &#8211; cho những người sử dụng Linux ở gia đình, văn phòng.</p>
<p>Hãng Borland (nay là hãng Inprise) đang phát triển một dự án có tên là KyLix, nhằm đưa ra một môi trường lập trình cấp cao trên Linux, đồng thời các ứng dụng trên Windows được viết bằng Delphi/C++Builder sẽ dễ dàng compile (biên dịch) lại dưới Linux bằng KyLix. Hiện tại Kylix đã có phiên bản thử nghiệm (beta).</p>
<p>Dự án này hứa hẹn một loạt các ứng dụng thông thường đã có trên MS Windows sẽ mau chóng được chuyển sang Linux, và điều này sẽ giúp cho hệ điều hành Linux dễ dàng thâm nhập vào thị trường PC nhanh chóng hơn.</p>
<p>Các ứng dụng được viết trên Linux đều có thể hoạt động trên các hệ thống UNIX (có thể cần phải compile lại).</p>
<p>Các release hiện nay gồm có:</p>
<p><strong>RedHat Linux (Fedora Core):</strong></p>
<p>Là phiên bản khá phổ biến. Cung cấp khá nhiều tool và utility để hỗ trợ user (người sử dụng) từ các thao tác setup (cài đặt) đến config (cấu hình) hệ thống.</p>
<p><strong>Mandrake Linux:</strong><br />
Một dòng khác thoát thai từ RedHat Linux, tương thích hoàn toàn với RedHat. Thường có nhiều phần mềm mới đang ở giai đoạn thử nghiệm.</p>
<p><strong>Slackware Linux:</strong><br />
Đây là một trong phiên bản Linux lâu đời. Hỗ trợ các dịch vụ mạng rất mạnh, tuy nhiên việc setup và config đòi hỏi user có kiến thức tốt về hệ điều hành này.</p>
<p><strong>S.u.S.E. Linux:</strong><br />
Do hãng S.u.S.E (Đức) phát hành, khá phổ biến tại Âu châu, nhưng không được phổ biến tại các nước khác. Có các công cụ riêng để hỗ trợ setup và config tương đối dễ sử dụng.</p>
<p>Free BSD Linux:<br />
Được phát triển bởi Đại Học Berkeley, đây không phải là phiên bản thương mại, do vậy ít được phổ biến. Có rất nhiều tiện ích dành cho việc phát triển hệ thống và lập trình. Hỗ trợ đầy đủ các shell trên Unix.</p>
<p><strong>Corel Linux:</strong><br />
Phát triển bởi hãng Corel, dễ setup, có graphic interface (giao diện đồ họa) khá giống Windows NT kể các tool và utility. Tuy nhiên các config tool chưa hoạt động tốt.</p>
<p><strong>Open Linux:</strong><br />
Do hãng Caldera phát triển, dễ cài đặt cũng như sử dụng. Giao diện KDE. Thích hợp cho người sử dụng tại gia đình.</p>
<p>Và còn rất nhiều release khác như Turbo Linux, Linux PPC, Debian Linux, Infomagic Linux, Softlanding Linux System Release (SLS) v.v&#8230;.</p>
<p>Ngoài ra, hiện nay còn có một dòng Linux gọi là Live-CD Linux (cahỵ trực tiếp trên CD &#8211; kô cần cài đặt) như Ubuntu, Knoppix, &#8230;&#8230;. thíchhợp với các beginner Linux</p>
<p>Các thông tin và tài nguyên (resource) của Linux có thể tìm thấy ở khắp nơi trên Internet và hầu hết đều free. Thêm vào đó có khá nhiều các trình ứng dụng cũng như tiện ích dành cho Linux dễ dàng được tìm thấy trên Internet.<br />
<img loading="lazy" decoding="async" class="aligncenter size-medium wp-image-1554" title="idatasafe-linux" src="http://tuvancongnghe.net/wp-content/uploads/2011/05/idatasafe-linux-300x127.jpg" alt="" width="300" height="127" srcset="https://tuvancongnghe.net/wp-content/uploads/2011/05/idatasafe-linux-300x127.jpg 300w, https://tuvancongnghe.net/wp-content/uploads/2011/05/idatasafe-linux.jpg 741w" sizes="(max-width: 300px) 100vw, 300px" /></p>
</div>
<div><strong>2. NHỮNG ỨNG DỤNG VĂN PHÒNG VÀ CƠ SỞ DỮ LIỆU:</strong><br />
NHỮNG ỨNG DỤNG VĂN PHÒNG: Những ứng dụng văn phòng của Linux rất đa dạng như chương trình sử lý văn bản mức chuyên nghiệp, chuơng trình tính toán, chương trình vẽ… Những bộ office văn phòng hiện nay của Linux cũng rất đa dạng được cung cấp bởi nhiều công ty khác nhau. Mỗi một bộ office văn phòng của Linux đều có những đặc tính riêng nhằm cung cấp cho người sử dụng những ứng dụng cần thiết, những bộ office được biết đến như: OpenOffice, KOffice, StarOffice, CrossOver Office, Ximian Desktop and office applications, GNOME Office…<br />
<strong>• OpenOffice:</strong> là bộ office nguồn mở sử dụng mã StarOffice nó cung cấp những ứng dụng văn phòng thích hợp như GNOME. OpenOffice hiện thời là ứng dụng văn phòng sơ cấp được hỗ trợ bởi Red Hat. Những ứng dụng của bộ office này gồm có: OpenCalc dùng để tính toán, OpenDraw là chương trình vẽ, OpenWriter dùng để sử lý văn bản, OpenMath dùng để tính toán và tạo ra những công thức toán học, OpenImpress dùng để tạo ra những bảng trình bày.<br />
<strong>• Koffice:</strong> là bộ office tự do dùng để thiết kế sử dụng với KDE. Những ứng dụng của bộ office này gồm có: Kspread dùng để tính toán, Kpresenter ứng dụng cho việc tạo ra những bảng trình bày, Kontour là chương trình bản vẽ vector, Karbon14 là chương trình đồ thị vector, Kword dùng để sử lý văn bản, Kformula là chương trình dùng để biên tập công thức toán, Kchart là công cụ vẽ những biểu đồ và sơ đồ, Kugar dùng cho việc lập các báo cáo, Krita là chương trình sử lý hình ảnh, Kivio dùng để tạo ra các flowchart (tương tự như visio), Kontact bao gồm những ứng dụng như: mail, address book, và organizer tools.<br />
<strong>• StarOffice:</strong> là bộ office dùng riêng cho những ứng dụng trong lãnh vực thương mại.<br />
Hiện nay hãng Ximian đang phát triển một bộ office chuyên nghiệp hỗ trợ cả KDE lẫn GNOME. Hầu hết những bộ office của Linux đều được cung cấp miễn phí trên mạng internet giúp cho người sử dụng có thể tải những ứng dụng về máy mình. Dưới đây là nhửng địa chỉ internet để người sử dụng có thể biết thêm thông tin.<strong>3. NHỮNG ỨNG DỤNG TRONG VIỆC QUẢN LÝ CƠ SỞ DỮ LIỆU:</strong><br />
Những hệ thống quản lý cơ sở dữ liệu được sử dụng trong hệ điều hành Linux rất đa dạng, nó gồm những hệ thống quản lý cơ sở dữ liệu mức rất mạnh và được thiết kế hỗ trợ cho những cơ sở dữ liệu có quan hệ lớn như Oracle, Sybase, và DB2 của hãng IBM… Red Hat cũng đã cung cấp cho Linux những hệ thống quản lý cơ sở dữ liệu lớn như MySQL và PostgreSQL. Tuy nhiên ngoài những hệ thống quản lý cơ sở dữ liệu ở mức lớn, Linux còn được cung cấp những hệ thống quản lý dữ liệu vừa và nhỏ như KDE và GNOME. Ngoài ra Linux còn cung được cung cấp những phần mềm sẵn sàng cho những cơ sở dữ liệu truy nhập với ngôn ngữ lập trình như Xbase.</p>
<p><strong>* Oracle :</strong> là phiên bản của hệ thống quản lý cơ sở dữ liệu Oracle9i. Nó có đầy đủ những chức năng mà Oracle9i có, là một cơ sở dữ liệu chuyên nghiệp sử dụng cho những cơ sở dữ liệu lớn chuyên dùng cho việc kinh doanh điện tử internet. Đây là hệ thống cơ sở dữ liệu được cấp phát miễn phí hoàn toàn, người sử dụng có thể tải những ứng dụng của hệ thống quản lý cơ sở dữ liệu này từ web-site www.oracle.com.</p>
<p><strong>* Sybase:</strong> là hệ thống cơ sở dữ liệu được ứng dụng phục vụ cho việc quản lý những cơ sở dữ liệu ở các xí nghiệp, công ty vừa và nhỏ. Hệ thống này có được đặc tính hợp nhất dữ liệu và kết hợp tất cả những tài nguyên thông tin trên cùng một mạng. Hệ thống này cũng được cung cấp miễn phí trên web-site www.sybase.com.</p>
<p><strong>* DB2:</strong> là hệ thống quản lý cơ sở dữ liệu được cung cấp bởi hãng máy tính nổi tiếng IBM. DB2 là hệ thống quản lý cơ sở dữ liệu mang tính phổ thông trong hệ thống của Linux nó bao gồm tính hoạt động internet cùng với sự bổ trợ cho Java và Perl. Ngoài ra DB2 còn có tính biến đổi được để mở rộng cơ sở dữ liệu một cách dễ dàng. Người sử dụng có thể tự do tải ứng dụng của hệ thống này về từ trang wed của IBM www.software.ibm.com/data/db2/linux/</p>
<p><strong>* MySQL:</strong> là hệ thống do Red Hat phát triển, là sản phẩm nguồn mở sẵn sàng tự do dưới giấy phép GPL. Nó là một hệ thống quản lý cơ sở dữ liệu nhanh cho những cơ sở dữ liệu lớn, đáng tin cậy có thể sử dụng với cường độ cao. Những người sử dụng có thể vào wed-site www.mysql.com để tìm hiểu thông tin của hệ thống này.</p>
<p><strong>* PostgreSQL: </strong>cũng là một hệ thống quản lý cơ sở dữ liệu do Red Hat cung cấp. Nó được sử dụng để cung cấp cho cơ sở dữ liệu hỗ trợ cho những dịch vụ nghiêng về internet và hệ thống mạng. Ưu điểm của hệ thống này là thao tác sử dụng đơn giản. Cũng như các hệ thống quản lý cơ sở dữ liệu trên những thông tin của ứng dụng này cũng được đưa lên các wed-site để người sử dụng có thể truy xuất được thông tin như www.postgresql.org.</p>
<p><strong>4. HỆ ĐIỀU HÀNH MẠNG VÀ CÁC ỨNG DỤNG VỀ MẠNG:</strong></p>
<p>Có thể nói các ứng dụng mạng là tập hợp những ứng dụng nổi bật nhất của hệ điều hành Linux, những khả năng mà các ứng dụng mạng trên Linux có thể thực hiện được làm cho hệ điều hành này vượt trội hơn so với hệ điều hành Window.</p>
<p>Linux cho phép người dùng có thể cấu hình một server với đầy đủ các ứng dụng cơ bản nhất của internet:<br />
• Domain Name Service (DNS)<br />
• Web Server<br />
• Web Proxy Server<br />
• Routing<br />
• SMTP Server<br />
• Pop3 Server<br />
• Firewall</p>
<p>Một mạng máy tính của Linux bao gồm:<br />
• Linux file server<br />
• Linux backup<br />
• Linux firewall<br />
• Các client (có thể chạy nhiều hệ điều hành khác nhau Unix, Macintosh và Windows)<br />
• Linux print server<br />
• Linux Apache<br />
• Linux database<br />
• Linux-Based DNS ( Domain Name System )</p>
<p><em> Sưu tầm từ nhiều nguồn trên internet</em></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://tuvancongnghe.net/tim-hieu-ve-he-dieu-hanh-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
