<?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>câu lệnh trong linux &#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/tag/cau-lenh-trong-linux/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>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>Các câu lệnh Linux căn bản &#8211; Kiến thức hệ điều hành Linux</title>
		<link>https://tuvancongnghe.net/cac-cau-lenh-linux-can-ban-kien-thuc-he-dieu-hanh-linux/</link>
					<comments>https://tuvancongnghe.net/cac-cau-lenh-linux-can-ban-kien-thuc-he-dieu-hanh-linux/#respond</comments>
		
		<dc:creator><![CDATA[Bảo Châu]]></dc:creator>
		<pubDate>Fri, 06 May 2011 09:35:04 +0000</pubDate>
				<category><![CDATA[Kiến thức tin học]]></category>
		<category><![CDATA[câu lệnh trong linux]]></category>
		<category><![CDATA[hệ điều hành linux]]></category>
		<category><![CDATA[kiến thức linux]]></category>
		<category><![CDATA[kiến thức tin học]]></category>
		<guid isPermaLink="false">http://tuvancongnghe.net/?p=1548</guid>

					<description><![CDATA[Tư vấn công nghệ xin giới thiệu tới các bạn một số lệnh cơ bản trong hệ điều hành Linux. Nếu bạn nào chưa hiểu Linux là gì? Hãy tìm hiểu tại trang web của chúng tôi theo link sau: hệ điều hành linux Các Lệnh Về Khởi Tạo rlogin: dùng để điều khiển hoặc [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Tư vấn công nghệ xin giới thiệu tới các bạn một số lệnh cơ bản trong hệ điều hành Linux. Nếu bạn nào chưa hiểu Linux là gì? Hãy tìm hiểu tại trang web của chúng tôi theo link sau:<a href="http://tuvancongnghe.net/tim-hieu-ve-he-dieu-hanh-linux/"> hệ điều hành linux</a></p>
<p><a href="http://tuvancongnghe.net/wp-content/uploads/2011/05/itGate-Feb21_hostname-centos.jpg"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1549" title="itGate-Feb21_hostname-centos" src="http://tuvancongnghe.net/wp-content/uploads/2011/05/itGate-Feb21_hostname-centos.jpg" alt="" width="448" height="303" srcset="https://tuvancongnghe.net/wp-content/uploads/2011/05/itGate-Feb21_hostname-centos.jpg 448w, https://tuvancongnghe.net/wp-content/uploads/2011/05/itGate-Feb21_hostname-centos-300x202.jpg 300w" sizes="(max-width: 448px) 100vw, 448px" /></a></p>
<p><strong>Các Lệnh Về Khởi Tạo</strong></p>
<p><span style="color: #000000;"> rlogin: </span>dùng để điều khiển hoặc thao tác lệnh trên một máy khác</p>
<p>exit : thoát khỏi hệ thống (Bourne-Shell)</p>
<p>logout: thoát khỏi hệ thống C-Shell</p>
<p>id : chỉ danh của người sử dụng</p>
<p>logname: tên người sử dụng login</p>
<p>man : giúp đỡ</p>
<p>newgrp: chuyển người sử dụng sang một nhóm mới</p>
<p>psswd: thay đổi password của người sử dụng</p>
<p>set : xác định các biến môi trường</p>
<p>tty : đặt các thông số terminal</p>
<p>uname: tên của hệ thống (host)</p>
<p>who : cho biết những ai đang thâm nhập hệ thống</p>
<p><strong>Lệnh Về Trình Báo Màn Hình</strong></p>
<p>echo: hiển thị dòng ký tự hay biến</p>
<p>setcolor: đặt màu nền và chữ của màn hình</p>
<p>Lệnh Về Desktop bc: tính biểu thức số học</p>
<p>cal : máy tính cá nhân</p>
<p>date: hiển thị và đặt ngày</p>
<p>mail: gửi &#8211; nhận thư tín điện tử</p>
<p>mesg : cấm/cho phép hiển thị thông báo trên màn hình (bởi write/ hello)</p>
<p>spell : kiểm tra lỗi chính tả</p>
<p>vi : soạn thảo văn bản</p>
<p>write/hello: cho phép gửi dòng thông báo đến những người sử dụng trong hệ thống</p>
<p><strong>Lệnh Về Thư Mục cd : đổi thư mục</strong></p>
<p>cp : sao chép 2 thư mục</p>
<p>mkdir: tạo thư mục</p>
<p>rm : loại bỏ thư mục</p>
<p>pwd: trình bày thư mục hiện hành</p>
<p><strong>Lệnh về tập tin more: trình bày nội dung tập tin</strong></p>
<p>cp : sao chép một hay nhiều tập tin</p>
<p>find: tìm vị trí của tập tin</p>
<p>grep : tìm vị trí của chuỗi ký tự trong tập tin</p>
<p>ls: trình bày tên và thuộc tính của các tập tin trong thư mục</p>
<p>mv : di chuyển/đổi tên một tập tin</p>
<p>sort: sắp thứ tự nội dung tập tin</p>
<p>wc : đếm số từ trong tập tin</p>
<p>cat: hiển thị nội dung moat tập tin</p>
<p>vi: soạn thảo hoặc sửa đổi nội dung tập tin</p>
<p><strong>Lệnh về quản lý quá trình: kill: hủy bỏ một quá trình</strong></p>
<p>ps : trình bày tình trạng của các quá trình</p>
<p>sleep: ngưng hoạt động một thời gian<br />
<strong><br />
Các Lệnh Về Phân Quyền chgrp: chuyển chủ quyền tập tin, thư mục từ một nhóm sang một nhóm khác</strong></p>
<p>chmod : thay đổi quyền sở hữu của tập tin hay thư mục</p>
<p>chown : thay đổi người sở hữu tập tin hay thư mục</p>
<p>Lệnh Về Kiểm Soát In cancel : ngưng in</p>
<p>lp : in tài liệu ra máy in<br />
<strong><br />
Lệnh về hệ thống:</strong><br />
top: Xem trạng thái về hệ thống và các process đang chạy tương tự như Task Manager trong Windows.<br />
shutdown -h now tắt máy tính<br />
shutdown -r now : khởi động lại<br />
Riêng cho RedHat Theo tôi được biết thì ở Việt Nam hiện nay HDH Linux phổ biến nhất là Redhat nên ở đây chúng xin trình bày thêm về rpm</p>
<p>Để install một package:<br />
rpm -ivh</p>
<p>Để upgrade một package:<br />
rpm -Uvh</p>
<p>Để uninstall một package:<br />
rpm -e</p>
<p>Để biết một package đã được install hay chưa<br />
rpm -q</p>
<p>filename ở đây có thể là 1 file hoặc nhiều file với format rpm</p>
<p>Các lệnh thường có thêm rất nhiều các thông số đi theo. Để biết thêm và chi tiết về chúng các bạn có thể dùng lệnh<br />
man command hoặc command &#8211;help với command là lệnh cần xem.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tuvancongnghe.net/cac-cau-lenh-linux-can-ban-kien-thuc-he-dieu-hanh-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
