<?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>grep command &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/tag/grep-command/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Fri, 28 Dec 2012 08:33:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.15</generator>
	<item>
		<title>How To Kill Process In Linux</title>
		<link>https://lifelinux.com/how-to-kill-process-in-linux/</link>
					<comments>https://lifelinux.com/how-to-kill-process-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sat, 21 May 2011 11:29:34 +0000</pubDate>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[grep command]]></category>
		<category><![CDATA[kill command]]></category>
		<category><![CDATA[kill process by name]]></category>
		<category><![CDATA[kill process linux]]></category>
		<category><![CDATA[kill process with kill]]></category>
		<category><![CDATA[killall command]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pidof command]]></category>
		<category><![CDATA[ps command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=705</guid>

					<description><![CDATA[<p>Sometimes, I need to kill a process in Linux. So, how can I do that ? In this article, i will explain how do I kill process in Linux. Kill process using PID (Using kill command) kill command sends a signal to a specified process. If no signal is specified, the TERM signal is sent. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-kill-process-in-linux/">How To Kill Process In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>Sometimes, I need to kill a process in Linux. So, how can I do that ? In this article, i will explain how do I kill process in Linux.<br />
<span id="more-705"></span></p>
<h2>Kill process using PID (Using kill command)</h2>
<p><strong>kill command</strong> sends a signal to a specified process. If no signal is specified, the TERM signal is sent. The TERM signal will kill a process. For a list of possible signals, type &#8216;man 7 signal&#8217; in a terminal window.<br />
First you must determine the PID of the process you want to kill. This can be done usually pretty easily with the ps command in Linux. Example, find process ID of mysqld, type the following command</p>
<pre># ps aux | grep mysql</pre>
<p>Output</p>
<pre>mysql     <span style="color: #ff0000;">1815</span>  0.0  0.2 254112  3844 ?        Ssl  May16   0:51 /usr/sbin/mysqld</pre>
<p>Finally,  kill process using PID. Above command tell you PID (1815) of mysqld process. Now kill process using this PID:</p>
<pre># kill 1815</pre>
<p>Or</p>
<pre># kill -9 1815</pre>
<p>Note: &#8220;-9&#8221; option is special Kill signal which will kill the process and cannot be blocked. Do not issue &#8220;kill -9&#8221; to a process connected to a database or to a database engine process.</p>
<h3>Using top command</h3>
<p>Example, I will kill mysqld process, First, type the following command as root</p>
<pre># top</pre>
<p>On screen, process id of mysql is 1815. I will press &#8220;k&#8221; and enter: 1815 to kill mysqld process. The screen will look like<br />
<a href="http://www.lifelinux.com/wp-content/uploads/2011/05/top-command.png"><img class="aligncenter size-full wp-image-712" title="Kill Process With Top Command" src="http://www.lifelinux.com/wp-content/uploads/2011/05/top-command.png" alt="Kill Process With Top Command" width="500" srcset="https://lifelinux.com/wp-content/uploads/2011/05/top-command.png 695w, https://lifelinux.com/wp-content/uploads/2011/05/top-command-300x215.png 300w" sizes="(max-width: 695px) 100vw, 695px" /></a></p>
<h3>Kill processes by name</h3>
<p>You can use killall command. The killall command kill processes by name. Example kill mysqld processes, type the following command</p>
<pre># killall mysqld</pre>
<p>Or</p>
<pre># killall -9 mysqld</pre>
<g:plusone href="https://lifelinux.com/how-to-kill-process-in-linux/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-kill-process-in-linux/">How To Kill Process In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-kill-process-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Find Hard Drive Specifications</title>
		<link>https://lifelinux.com/how-to-find-hard-drive-specifications/</link>
					<comments>https://lifelinux.com/how-to-find-hard-drive-specifications/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 19 May 2011 15:44:16 +0000</pubDate>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[df command]]></category>
		<category><![CDATA[disk partition]]></category>
		<category><![CDATA[disk size]]></category>
		<category><![CDATA[disk space]]></category>
		<category><![CDATA[du command]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[fdisk command]]></category>
		<category><![CDATA[filesystem 1k]]></category>
		<category><![CDATA[gb]]></category>
		<category><![CDATA[grep command]]></category>
		<category><![CDATA[hard disk]]></category>
		<category><![CDATA[harddisk size]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[manipulator]]></category>
		<category><![CDATA[mega bytes]]></category>
		<category><![CDATA[partition size]]></category>
		<category><![CDATA[partition table]]></category>
		<category><![CDATA[root user]]></category>
		<category><![CDATA[shm]]></category>
		<category><![CDATA[space available]]></category>
		<category><![CDATA[tb type]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[unix operating systems]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=669</guid>

					<description><![CDATA[<p>There are many tools to get hard drive information such as smartctl, hdparm, hwinfo&#8230; In this article, i will use hdparm command which provides a command line interface to various hard disk ioctls supported by the stock Linux ATA/IDE device driver subsystem. hdparm read information such as model number, serial number, device size and much [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-find-hard-drive-specifications/">How To Find Hard Drive Specifications</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>There are many tools to get hard drive information such as smartctl, hdparm, hwinfo&#8230; In this article, i will use <strong>hdparm</strong> command which provides a command line interface to various hard disk ioctls supported by the stock Linux ATA/IDE device driver subsystem.<span id="more-669"></span></p>
<p><strong>hdparm</strong> read information such as model number, serial number, device size and much more directly from the drive. Login as root and type the following command</p>
<pre># hdparm -I /dev/sda</pre>
<p>Sample output</p>
<pre>/dev/sda:

ATA device, with non-removable media
	Model Number:       <span style="color: #008000;">SAMSUNG HM320HJ</span>                         
	Serial Number:      <span style="color: #008000;">S2ANJ1MZ804243</span>
	Firmware Revision:  <span style="color: #008000;">2AK10001</span>
	Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6
Standards:
	Used: unknown (minor revision code 0x0028) 
	Supported: 8 7 6 5 
	Likely used: 8
Configuration:
	Logical		max	current
	cylinders	16383	16383
	heads		16	16
	sectors/track	63	63
	--
	CHS current addressable sectors:   16514064
	LBA    user addressable sectors:  268435455
	LBA48  user addressable sectors:  625142448
	Logical  Sector size:                   512 bytes
	Physical Sector size:                   512 bytes
	device size with M = 1024*1024:      305245 MBytes
	device size with M = 1000*1000:      <span style="color: #008000;">320072 MBytes (320 GB)</span>
	cache/buffer size  = 16384 KBytes
	Form Factor: 2.5 inch
	Nominal Media Rotation Rate: 7200
Capabilities:
	LBA, IORDY(can be disabled)
	Queue depth: 32
	Standby timer values: spec'd by Standard, no device specific minimum
	R/W multiple sector transfer: Max = 16	Current = 16
	Advanced power management level: 254
	Recommended acoustic management value: 254, current value: 0
	DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
	     Cycle time: min=120ns recommended=120ns
	PIO: pio0 pio1 pio2 pio3 pio4 
	     Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
	Enabled	Supported:
	   *	SMART feature set
	    	Security Mode feature set
	   *	Power Management feature set
	   *	Write cache
	   *	Look-ahead
	   *	Host Protected Area feature set
	   *	WRITE_BUFFER command
	   *	READ_BUFFER command
	   *	NOP cmd
	   *	DOWNLOAD_MICROCODE
	   *	Advanced Power Management feature set
	    	Power-Up In Standby feature set
	   *	SET_FEATURES required to spinup after power up
	    	SET_MAX security extension
	    	Automatic Acoustic Management feature set
	   *	48-bit Address feature set
	   *	Device Configuration Overlay feature set
	   *	Mandatory FLUSH_CACHE
	   *	FLUSH_CACHE_EXT
	   *	SMART error logging
	   *	SMART self-test
	   *	General Purpose Logging feature set
	   *	64-bit World wide name
	   *	IDLE_IMMEDIATE with UNLOAD
	   *	WRITE_UNCORRECTABLE_EXT command
	   *	{READ,WRITE}_DMA_EXT_GPL commands
	   *	Segmented DOWNLOAD_MICROCODE
	   *	<span style="color: #008000;">Gen1 signaling speed (1.5Gb/s)</span>
	   *	<span style="color: #008000;">Gen2 signaling speed (3.0Gb/s)</span>
	   *	Native Command Queueing (NCQ)
	   *	Host-initiated interface power management
	   *	Phy event counters
	   *	Idle-Unload when NCQ is active
	   *	NCQ priority information
	   *	DMA Setup Auto-Activate optimization
	   *	Device-initiated interface power management
	   *	Software settings preservation
	   *	SMART Command Transport (SCT) feature set
	   *	SCT Long Sector Access (AC1)
	   *	SCT LBA Segment Access (AC2)
	   *	SCT Error Recovery Control (AC3)
	   *	SCT Features Control (AC4)
	   *	SCT Data Tables (AC5)
Security: 
	Master password revision code = 65534
		supported
	not	enabled
	not	locked
		frozen
	not	expired: security count
		supported: enhanced erase
	60min for SECURITY ERASE UNIT. 60min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 50024e9003dedbf0
	NAA		: 5
	IEEE OUI	: 0024e9
	Unique ID	: 003dedbf0
Checksum: correct</pre>
<h3>Future reading</h3>
<p>hdparm <a href="http://linux.die.net/man/8/hdparm">man page</a><br />
<a href="http://www.lifelinux.com/linux-hard-disk-speed-tests/">Linux hard disk speed tests</a></p>
<g:plusone href="https://lifelinux.com/how-to-find-hard-drive-specifications/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-find-hard-drive-specifications/">How To Find Hard Drive Specifications</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-find-hard-drive-specifications/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux Display CPU Information</title>
		<link>https://lifelinux.com/linux-display-cpu-information/</link>
					<comments>https://lifelinux.com/linux-display-cpu-information/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 19 May 2011 14:57:12 +0000</pubDate>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[cat command]]></category>
		<category><![CDATA[cpuinfo]]></category>
		<category><![CDATA[grep command]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[lshw]]></category>
		<category><![CDATA[lshw command]]></category>
		<category><![CDATA[number of processors]]></category>
		<category><![CDATA[proc cpuinfo file]]></category>
		<category><![CDATA[xeon]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=651</guid>

					<description><![CDATA[<p>Q. How do I display CPU information in Linux ? A.You can get information of /proc/cpuinfo file or use lshw command to display CPU information in Linux. Display CPU information from /proc/cpuinfo file /proc/cpuinfo is a short, read-only, plain text file that contains information about the CPUs (central processing units) on a computer. Type the following command [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/linux-display-cpu-information/">Linux Display CPU Information</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><span style="color: #ff0000;">Q.</span> How do I display CPU information in Linux ?<br />
<span style="color: #008000;">A.</span>You can get information of <strong>/proc/cpuinfo</strong> file or use <strong>lshw</strong> command to display CPU information in Linux.<span id="more-651"></span></p>
<h3>Display CPU information from /proc/cpuinfo file</h3>
<p><strong>/proc/cpuinfo</strong> is a short, read-only, plain text file that contains information about the CPUs (central processing units) on a computer.<br />
Type the following command to display CPU information:</p>
<pre># cat /proc/cpuinfo</pre>
<p>Sample outputs</p>
<pre>processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 37
model name	: Intel(R) Core(TM) i3 CPU       M 350  @ 2.27GHz
stepping	: 5
cpu MHz		: 931.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm arat dts tpr_shadow vnmi flexpriority ept vpid
bogomips	: 4522.67
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:
...</pre>
<p>To display number of processors in the system, type the following command:</p>
<pre># cat /proc/cpuinfo | grep processor</pre>
<p>Sample output</p>
<pre>processor	: 0
processor	: 1
processor	: 2
processor	: 3</pre>
<h3>Using lshw command</h3>
<p>Type the following command</p>
<pre># lshw -class processor</pre>
<p>Sample output</p>
<pre>WARNING: you should run this program as super-user.
  *-cpu
       product: Intel(R) Core(TM) i3 CPU       M 350  @ 2.27GHz
       vendor: Intel Corp.
       physical id: 1
       bus info: cpu@0
       size: 931MHz
       capacity: 931MHz
       width: 64 bits
       capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp x86-64 constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm arat tpr_shadow vnmi flexpriority ept vpid cpufreq</pre>
<g:plusone href="https://lifelinux.com/linux-display-cpu-information/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/linux-display-cpu-information/">Linux Display CPU Information</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/linux-display-cpu-information/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>10 lsof Command Examples</title>
		<link>https://lifelinux.com/10-lsof-command-examples/</link>
					<comments>https://lifelinux.com/10-lsof-command-examples/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sat, 14 May 2011 16:41:13 +0000</pubDate>
				<category><![CDATA[Bash Shell]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[command line options]]></category>
		<category><![CDATA[fuser command]]></category>
		<category><![CDATA[grep command]]></category>
		<category><![CDATA[grep program]]></category>
		<category><![CDATA[internet connections]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux-distributions]]></category>
		<category><![CDATA[list open files]]></category>
		<category><![CDATA[ls command]]></category>
		<category><![CDATA[lsof]]></category>
		<category><![CDATA[lsof command]]></category>
		<category><![CDATA[netstat command]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[port numbers]]></category>
		<category><![CDATA[process id]]></category>
		<category><![CDATA[proto]]></category>
		<category><![CDATA[ps command]]></category>
		<category><![CDATA[running processes]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[udp]]></category>
		<category><![CDATA[UNIX]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=523</guid>

					<description><![CDATA[<p>The lsof command or &#8220;list open files&#8221; command in Linux is a powerful tool. In Linux and Unix everything behind the scenes are just files. This includes IP sockets, pipes, unix sockets, directories, devices, even inodes are just files. This means that lsof can actually tell you a lot of information of what is going [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/10-lsof-command-examples/">10 lsof Command Examples</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>The <strong>lsof command</strong> or &#8220;list open files&#8221; command in Linux is a powerful tool. In Linux and Unix everything behind the scenes are just files. This includes IP sockets, pipes, unix sockets, directories, devices, even inodes are just files. This means that lsof can actually tell you a lot of information of what is going on on your system.<span id="more-523"></span></p>
<h3>Synopsis</h3>
<pre>
lsof [ -?abChlnNOPRstUvVX ] [ -A A ] [ -c c ] [ +|-d d ] [ +|-D D ] [ +|-f [cfgGn] ] [ -F [f] ] [ -g [s] ] [ -i [i] ] [ -k k ] [ +|-L [l] ] [ -m m ] [ +|-M ] [ -o [o] ] [ -p s ] [ +|-r [t] ] [ -S [t] ] [ -T [t] ] [ -u s ] [ +|-w ] [ -- ] [names] 
</pre>
<h3>Example 1: Show all opened files</h3>
<p>Type the following command</p>
<pre>
lsof | more
</pre>
<p>Sample outputs</p>
<pre>
COMMAND     PID      USER   FD      TYPE     DEVICE      SIZE       NODE NAME
init          1      root  cwd       DIR      253,4      4096          2 /
init          1      root  rtd       DIR      253,4      4096          2 /
init          1      root  txt       REG      253,4     38652   41746599 /sbin/init
init          1      root  mem       REG      253,4    129900   16252964 /lib/ld-2.5.so
init          1      root  mem       REG      253,4   1693812   16252965 /lib/libc-2.5.so
init          1      root  mem       REG      253,4     20668   16253168 /lib/libdl-2.5.so
init          1      root  mem       REG      253,4    245376   16253222 /lib/libsepol.so.1
init          1      root  mem       REG      253,4     93508   16253815 /lib/libselinux.so.1
init          1      root   10u     FIFO       0,17                 1277 /dev/initctl
...
</pre>
<h3>Example 2: Show all opened internet sockets</h3>
<p>Using the -i flag lsof will list the internet sockets currently opened</p>
<pre>
lsof -i
</pre>
<p>Sample outputs</p>
<pre>
COMMAND     PID   USER   FD   TYPE   DEVICE SIZE NODE NAME
sshd       2537   root    3u  IPv6     5348       TCP *:rockwell-csp2 (LISTEN)
mysqld     2625  mysql   11u  IPv4     5463       TCP *:mysql (LISTEN)
httpd      2731 apache    3u  IPv6 30048993       TCP *:http (LISTEN)
...
</pre>
<h3>Example 3: Shows all networking related to a given port 80</h3>
<pre>
lsof -i :80
</pre>
<p>Sample outputs</p>
<pre>
COMMAND   PID   USER   FD   TYPE   DEVICE SIZE NODE NAME
httpd    2731 apache    3u  IPv6 30048993       TCP *:http (LISTEN)
httpd    2731 apache   58u  IPv6 39448263       TCP server.com:http->adsl-dynamic-pool-xxx.hcm.fpt.vn:23527 (ESTABLISHED)
httpd    2731 apache   60u  IPv6 39448302       TCP server.com:http->crawl-66-249-69-83.googlebot.com:35190 (ESTABLISHED)
httpd    2731 apache   61u  IPv6 39448336       TCP server.com:http->v16-13.opera-mini.net:37548 (ESTABLISHED)
httpd    2731 apache   62u  IPv6 39448388       TCP server.com:http->v16-13.opera-mini.net:37561 (ESTABLISHED)
httpd    2731 apache   64u  IPv6 39447543       TCP server.com:http->adsl.viettel.vn:13636 (FIN_WAIT2)
</pre>
<h3>Example 4: Show all TCP/UDP connections</h3>
<pre>
lsof -i TCP
</pre>
<p>Sample outputs</p>
<pre>
sshd       2537   root    3u  IPv6     5348       TCP *:rockwell-csp2 (LISTEN)
mysqld     2625  mysql   11u  IPv4     5463       TCP *:mysql (LISTEN)
httpd      2731 apache    3u  IPv6 30048993       TCP *:http (LISTEN)
...
</pre>
<h3>Example 5: List open files associated with process ID</h3>
<p>The flag +p will display all open files associated with specific process ID, example with process ID is 2625</p>
<pre>
lsof +p 2625
</pre>
<p>Sample outputs</p>
<pre>
COMMAND  PID  USER   FD   TYPE     DEVICE      SIZE     NODE NAME
mysqld  2625 mysql  cwd    DIR      253,4      4096 21495811 /var/lib/mysql
mysqld  2625 mysql  rtd    DIR      253,4      4096        2 /
mysqld  2625 mysql  txt    REG      253,4   7020300 50999198 /usr/libexec/mysqld
mysqld  2625 mysql  DEL    REG      253,4           16253135 /lib/libcrypto.so.0.9.8e.#prelink#.64u8kX
mysqld  2625 mysql  mem    REG      253,4           16252984 /lib/libm-2.5.so (path inode=16253122)
mysqld  2625 mysql  DEL    REG      253,4           50996047 /usr/lib/libgssapi_krb5.so.2.2.#prelink#.YYIHuy
mysqld  2625 mysql  mem    REG      253,4           16252990 /lib/libselinux.so.1 (path inode=16253815)
mysqld  2625 mysql  mem    REG      253,4           16256252 /lib/libsepol.so.1 (path inode=16253222)
mysqld  2625 mysql  mem    REG      253,4     50848 16253138 /lib/libnss_files-2.5.so
mysqld  2625 mysql  mem    REG      253,4           16253825 /lib/librt-2.5.so (path inode=16253220)
mysqld  2625 mysql  mem    REG      253,4           16252942 /lib/ld-2.5.so (path inode=16252964)
mysqld  2625 mysql  mem    REG      253,4           50996107 /usr/lib/libstdc++.so.6.0.8 (path inode=50989584)
mysqld  2625 mysql  mem    REG      253,4           50996061 /usr/lib/libkrb5.so.3.3 (path inode=50999803)
mysqld  2625 mysql  mem    REG      253,4           16252980 /lib/libdl-2.5.so (path inode=16253168)
...
</pre>
<h3>Example 6: Show what a given user has open</h3>
<p>The flag -u will show what a given user has open</p>
<pre>
lsof -u apache
</pre>
<p>Sample outputs</p>
<pre>
COMMAND   PID   USER   FD   TYPE     DEVICE      SIZE     NODE NAME
httpd    2731 apache  cwd    DIR      253,4      4096        2 /
httpd    2731 apache  rtd    DIR      253,4      4096        2 /
httpd    2731 apache  txt    REG      253,4   3120954 51157630 /usr/local/apache/bin/httpd
httpd    2731 apache  mem    REG      253,4    375710 51157607 /usr/local/apache/lib/libaprutil-1.so.0.3.10
httpd    2731 apache  mem    REG      253,4     45432 16253184 /lib/libcrypt-2.5.so
httpd    2731 apache  mem    REG      253,4      7748 16253849 /lib/libcom_err.so.2.1
httpd    2731 apache  mem    REG      253,4      7880 16253845 /lib/libkeyutils-1.2.so
httpd    2731 apache  mem    REG      253,4    937178 51157689 /usr/local/apache/modules/mod_security2.so
httpd    2731 apache  mem    REG      253,4    129208 16253851 /lib/libpcre.so.0.0.1
...
</pre>
<g:plusone href="https://lifelinux.com/10-lsof-command-examples/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/10-lsof-command-examples/">10 lsof Command Examples</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/10-lsof-command-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Install RPM File On CentOS / RedHat</title>
		<link>https://lifelinux.com/install-rpm-file-on-centos-redhat/</link>
					<comments>https://lifelinux.com/install-rpm-file-on-centos-redhat/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sun, 08 May 2011 10:53:15 +0000</pubDate>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[grep command]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux system administrator]]></category>
		<category><![CDATA[linux yum commands]]></category>
		<category><![CDATA[package management system]]></category>
		<category><![CDATA[rhn]]></category>
		<category><![CDATA[rpm -ev]]></category>
		<category><![CDATA[rpm -ivh]]></category>
		<category><![CDATA[rpm -qa]]></category>
		<category><![CDATA[rpm -ql]]></category>
		<category><![CDATA[rpm command]]></category>
		<category><![CDATA[rpm uvh]]></category>
		<category><![CDATA[system updates]]></category>
		<category><![CDATA[yum]]></category>
		<category><![CDATA[yum command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=339</guid>

					<description><![CDATA[<p>rpm is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages. A package consists of an archive of files and meta-data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package. Packages come in [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/install-rpm-file-on-centos-redhat/">Install RPM File On CentOS / RedHat</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>rpm</strong> is a powerful <strong>Package Manager</strong>, which can be used to build, install, query, verify, update, and erase individual software packages. A package consists of an archive of files and meta-data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package. Packages come in two varieties: binary packages, used to encapsulate software to be installed, and source packages, containing the source code and recipe necessary to produce binary packages.<br />
<span id="more-339"></span></p>
<h3>Install RPM File</h3>
<p>To install an rpm file, open a terminal and then type the following command:</p>
<pre>
[root@server2 ~]# rpm -ivh file.rpm
</pre>
<p><strong>Note:</strong><br />
-i: Installs a new package<br />
-v: Print verbose information &#8211; normally routine progress messages will be displayed.<br />
-h: Print 50 hash marks as the package archive is unpacked. Use with -v|&#8211;verbose for a nicer display.</p>
<h3>Upgrade RPM File</h3>
<pre>
[root@server2 ~]# rpm -Uvh file.rpm
</pre>
<p><strong>Note:</strong><br />
-U: Upgrades or installs the package currently installed to a newer version. This is the same as install, except all other version(s) of the package are removed after the new package is installed.</p>
<h3>Erase RPM File</h3>
<pre>
[root@server2 ~]# rpm -ev ile.rpm
</pre>
<p><strong>Note:</strong><br />
-e: Erase command<br />
The following options may also be used:</p>
<pre>
--nodeps
</pre>
<p>Don&#8217;t check dependencies before uninstalling the packages.</p>
<h3>List of all install packages</h3>
<p>Type the following command:</p>
<pre>
[root@server2 ~]# rpm -qa 
</pre>
<p>Sample outputs:</p>
<pre>
...
libxslt-devel-1.1.17-2.el5_2.2
perl-libwww-perl-5.805-1.1.1
libc-client-devel-2004g-2.2.1
libidn-devel-0.6.5-1.1
libjpeg-devel-6b-37
gmp-devel-4.1.4-10.el5
libmcrypt-devel-2.5.8-4.el5.centos
libtidy-0.99.0-12.20070228.el5.centos
libtool-ltdl-1.5.22-7.el5_4
gpg-pubkey-1aa78495-3eb24301
openssl-0.9.8e-12.el5_5.7
NetworkManager-glib-0.7.0-10.el5_5.2
perl-XML-NamespaceSupport-1.09-1.2.1
perl-XML-Filter-BufferText-1.01-1.2.el5.rf
perl-XML-Simple-2.14-4.fc6
rsnapshot-1.3.1-1.el5.rf
</pre>
<p>List the files and state the installed version of the package called package. Example</p>
<pre>
[root@server2 ~]# rpm -ql mysql-5.0.77-4.el5_5.5
</pre>
<p>Sample outputs:</p>
<pre>
/etc/ld.so.conf.d/mysql-i386.conf
/etc/my.cnf
/usr/bin/msql2mysql
/usr/bin/my_print_defaults
/usr/bin/mysql
/usr/bin/mysql_config
/usr/bin/mysql_find_rows
/usr/bin/mysql_tableinfo
/usr/bin/mysql_waitpid
/usr/bin/mysqlaccess
/usr/bin/mysqladmin
/usr/bin/mysqlbinlog
/usr/bin/mysqlcheck
/usr/bin/mysqldump
/usr/bin/mysqlimport
/usr/bin/mysqlshow
/usr/lib/mysql
</pre>
<p><strong>Read the man page</strong></p>
<pre>
[root@server2 ~]# man rpm
</pre>
<g:plusone href="https://lifelinux.com/install-rpm-file-on-centos-redhat/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/install-rpm-file-on-centos-redhat/">Install RPM File On CentOS / RedHat</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/install-rpm-file-on-centos-redhat/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
