
<?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> &#187; Linux</title>
	<atom:link href="https://www.nikeshshk.com.np/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.nikeshshk.com.np</link>
	<description></description>
	<lastBuildDate>Tue, 04 Nov 2025 10:25:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.4</generator>
	<item>
		<title>Converting WAV files</title>
		<link>https://www.nikeshshk.com.np/news/converting-wav-files/</link>
		<comments>https://www.nikeshshk.com.np/news/converting-wav-files/#comments</comments>
		<pubDate>Tue, 09 Sep 2014 11:28:40 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[convert wav files]]></category>
		<category><![CDATA[gsm]]></category>
		<category><![CDATA[sox]]></category>

		<guid isPermaLink="false">http://www.nikeshshk.com.np/?p=778</guid>
		<description><![CDATA[Converting WAV files If you have a wav file (in what format?) you can convert it using the sox program. &#8211; Raw linear, signed 16 bit, mono, 8000 Hz (.slin) sox file.wav -t raw -r 8000 -c 1 -w -s file.slin &#8211; Raw mu-law, mono, 8000 Hz (.mulaw or .u) sox file.wav -t raw -r 8000 -c 1 -b 8 -U file.mulaw &#8211; Raw A-law, mono, 8000 Hz (.alaw or .A) sox file.wav -t raw -r 8000 -c 1 -b 8 -A file.alaw &#8211; Raw GSM, mono, 8000 Hz (.gsm) sox file.wav -t raw -r 8000 -c 1 -b 8 -g file.gsm (not all versions of sox support this conversion) &#8211; SUN/SGI audio/basic file, mono 8000 Hz (.au) containing: - Signed linear sox file.wav -r 8000 -c 1 -w -s file.au - alaw sox file.wav -r 8000 -c 1 -b 8 -A file.au - mulaw sox file.wav -r 8000 -c 1 -b 8 -U file.au In addition basic format &#8220;conversion&#8221;&#160;<a href="https://www.nikeshshk.com.np/news/converting-wav-files/" class="read-more">Continue Reading</a>]]></description>
				<content:encoded><![CDATA[<h3>Converting WAV files</h3>
<p>If you have a wav file (in what format?) you can convert it using the sox program.</p>
<p>&#8211; Raw linear, signed 16 bit, mono, 8000 Hz (.slin)</p>
<pre>    sox file.wav -t raw -r 8000 -c 1 -w -s file.slin</pre>
<p>&#8211; Raw mu-law, mono, 8000 Hz (.mulaw or .u)</p>
<pre>    sox file.wav -t raw -r 8000 -c 1 -b 8 -U file.mulaw</pre>
<p>&#8211; Raw A-law, mono, 8000 Hz (.alaw or .A)</p>
<pre>    sox file.wav -t raw -r 8000 -c 1 -b 8 -A file.alaw</pre>
<p>&#8211; Raw GSM, mono, 8000 Hz (.gsm)</p>
<pre>    sox file.wav -t raw -r 8000 -c 1 -b 8 -g file.gsm
    (not all versions of sox support this conversion)</pre>
<p>&#8211; SUN/SGI audio/basic file, mono 8000 Hz (.au) containing:</p>
<pre>    - Signed linear
        sox file.wav -r 8000 -c 1 -w -s file.au
    - alaw
        sox file.wav -r 8000 -c 1 -b 8 -A file.au
    - mulaw
        sox file.wav -r 8000 -c 1 -b 8 -U file.au</pre>
<p>In addition basic format &#8220;conversion&#8221; if needed:</p>
<p>&#8211; WAV into RAW (tested with an A-law, mono, 8000 Hz riff wavefile)</p>
<pre>    sox file.wav file.raw</pre>
<p>The SUN/SGI formats have the advantage of being easily playable in a Web browser and it also preserves the format information.</p>
<p><strong>The output format should always be mono, 8 kHz as that is required for telephony.</strong></p>
<h3>Converting into WAV files</h3>
<p>If you have a mono 8kHz raw data file you can convert it into wave file by using sox</p>
<p>&#8211; Raw A-law, mono, 8000 Hz (.alaw or .A)</p>
<pre>    sox -t raw -r 8000 -A -b 8 -c 1 file.alaw file.wav
</pre>
<p>&#8211; mulaw, mono 8000 Hz (.mulaw)</p>
<pre>    sox -t raw -r 8000 -U -b 8 -c 1 file.mulaw test.wav</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.nikeshshk.com.np/news/converting-wav-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Additional Disk Drives to CentOS 5/6</title>
		<link>https://www.nikeshshk.com.np/news/adding-additional-disk-drives-to-centos-56/</link>
		<comments>https://www.nikeshshk.com.np/news/adding-additional-disk-drives-to-centos-56/#comments</comments>
		<pubDate>Mon, 23 Jun 2014 14:15:16 +0000</pubDate>
		<dc:creator><![CDATA[Nikesh Shakya]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[add drive]]></category>
		<category><![CDATA[ext4]]></category>
		<category><![CDATA[fdisk]]></category>

		<guid isPermaLink="false">http://www.nikeshshk.com.np/?p=676</guid>
		<description><![CDATA[Making use of a second drive for extra space? Here&#8217;s a quick run-down: 1) Make sure you know which disk is being formatted. First, second, and third drives will be /dev/sda, /dev/sdb, and /dev/sdc respectively. Check this with fdisk -l [03:50:04] [root@virt ~]# fdisk -l Disk /dev/sda: 34.3 GB, 34359738368 bytes 255 heads, 63 sectors/track, 4177 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 4177 33447330 8e Linux LVM Disk /dev/sdb: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table 2) You can see that /dev/sdb (our second hard drive) does not have any partitions. We will need to create a partition(s) on the drive and then make a file system on it, then mount it. Let&#8217;s write partitions to the drive&#160;<a href="https://www.nikeshshk.com.np/news/adding-additional-disk-drives-to-centos-56/" class="read-more">Continue Reading</a>]]></description>
				<content:encoded><![CDATA[<div>
<p>Making use of a second drive for extra space? Here&#8217;s a quick run-down:</p>
<p>1) Make sure you know which disk is being formatted. First, second, and third drives will be /dev/sda, /dev/sdb, and /dev/sdc respectively. Check this with <code>fdisk -l</code></p>
<pre>[03:50:04] [root@virt ~]# fdisk -l

Disk /dev/sda: 34.3 GB, 34359738368 bytes
255 heads, 63 sectors/track, 4177 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        4177    33447330   8e  Linux LVM

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table</pre>
<p>2) You can see that /dev/sdb (our second hard drive) does not have any partitions. We will need to create a partition(s) on the drive and then make a file system on it, then mount it. Let&#8217;s write partitions to the drive using <code>fdisk /dev/sdb</code>:</p>
<pre>[03:53:01] [root@virt ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help):</pre>
<p>3) As you can see from the help menu (by using the command &#8220;m&#8221;) we want to add a new partition. Using the defaults will use the entire disk. After it&#8217;s created, you will want to use the command &#8220;w&#8221; to &#8220;write table to disk and exit&#8221;.</p>
<pre>Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): 
Using default value 1044

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[03:54:58] [root@virt ~]#</pre>
<p>4) Now you will notice that the output of <code>fdisk -l /dev/sdb</code> shows a partition as /dev/sdb1:</p>
<pre>[03:57:08] [root@virt ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1044     8385898+  83  Linux</pre>
<p>5) Now we need to create a file system on it. I&#8217;ve always used ext3 for general use/purposes. You&#8217;ll want to use the command <code>mkfs -t ext3 /dev/sdb1</code> as shown here:</p>
<pre>[03:58:38] [root@virt ~]# mkfs -t ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1048576 inodes, 2096474 blocks
104823 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.</pre>
<p>6) Great, now we have a single partitioned secondary drive using ext3 file system. Now you want to create a directory to mount it in; lets just use &#8220;/drive2&#8243;. You&#8217;ll need to use the command <code>mount -t [filesystem] [source] [mount directory]</code> to mount it.</p>
<pre>[03:59:50] [root@virt ~]# mount -t ext3 /dev/sdb1 /drive2/</pre>
<p>7) Now you&#8217;ll notice, via df, that the drive is mounted:</p>
<pre>[03:59:57] [root@virt ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       28G  1.4G   25G   6% /
/dev/sda1              99M   19M   76M  20% /boot
tmpfs                1014M     0 1014M   0% /dev/shm
/dev/sdb1             7.9G  147M  7.4G   2% /drive2</pre>
<p>8) Last step &#8211; you want to make sure the drive automatically mounts itself when the server boots/reboots. You&#8217;ll need to add the following line to your <code>/etc/fstab</code> file:</p>
<pre>/dev/sdb1  /drive2  ext3  defaults 0 0</pre>
<p>.</p>
<p>All done!</p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.nikeshshk.com.np/news/adding-additional-disk-drives-to-centos-56/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Killing zombie process</title>
		<link>https://www.nikeshshk.com.np/news/killing-zombie-process/</link>
		<comments>https://www.nikeshshk.com.np/news/killing-zombie-process/#comments</comments>
		<pubDate>Sat, 29 Mar 2014 12:06:00 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[zombie]]></category>

		<guid isPermaLink="false">http://www.nikeshshk.com.np/?p=660</guid>
		<description><![CDATA[Zombie process is an inactive computer process, according to wikipedia article, &#8220;&#8230;On Unix operating systems, a zombie process or defunct process is a process that has completed execution but still has an entry in the process table, allowing the process that started it to read its exit status. In the term&#8217;s colorful metaphor, the child process has died but has not yet been reaped&#8230;&#8221; So how do I find out zombie process? Use top or ps command: # top OR # ps aux &#124; awk &#8216;{ print $8 &#8221; &#8221; $2 }&#8217; &#124; grep -w Z Output: Z 4104 Z 5320 Z 2945 How do I kill zombie process? You cannot kill zombies, as they are already dead. But if you have too many zombies then kill parent process or restart service. You can kill zombie process using PID obtained from any one of the above command. For example kill zombie proces having PID 4104: # kill -9 4104 Please&#160;<a href="https://www.nikeshshk.com.np/news/killing-zombie-process/" class="read-more">Continue Reading</a>]]></description>
				<content:encoded><![CDATA[<p>Zombie process is an inactive computer process, according to wikipedia article, &#8220;&#8230;On Unix operating systems, a zombie process or defunct process is a process that has completed execution but still has an entry in the process table, allowing the process that started it to read its exit status. In the term&#8217;s colorful metaphor, the child process has died but has not yet been reaped&#8230;&#8221;<br />
So how do I find out zombie process?</p>
<p>Use top or ps command:<br />
# top<br />
OR<br />
# ps aux | awk &#8216;{ print $8 &#8221; &#8221; $2 }&#8217; | grep -w Z</p>
<p>Output:</p>
<p>Z 4104<br />
Z 5320<br />
Z 2945</p>
<p>How do I kill zombie process?</p>
<p>You cannot kill zombies, as they are already dead. But if you have too many zombies then kill parent process or restart service.</p>
<p>You can kill zombie process using PID obtained from any one of the above command. For example kill zombie proces having PID 4104:<br />
# kill -9 4104</p>
<p>Please note that kill -9 does not guarantee to kill a zombie process (see below for more info).<br />
How do I automate zombie process killing?</p>
<p>Write a script and schedule as a cron job.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.nikeshshk.com.np/news/killing-zombie-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find and Change File Permissions Recursively, Linux / UNIX</title>
		<link>https://www.nikeshshk.com.np/news/find-and-change-file-permissions-recursively-linux-unix/</link>
		<comments>https://www.nikeshshk.com.np/news/find-and-change-file-permissions-recursively-linux-unix/#comments</comments>
		<pubDate>Fri, 10 Jan 2014 06:20:12 +0000</pubDate>
		<dc:creator><![CDATA[Nikesh Shakya]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.nikeshshk.com.np/?p=624</guid>
		<description><![CDATA[To find all files in /home/user/demo directory, enter: $ find /home/user/demo -type f -print To find all files in /home/user/demo directory with permission 777, enter: $ find /home/user/demo -type f -perm 777 -print Finally, apply new permission using the -exec option as follows: $ find /home/user/demo -type f -perm 777 -print -exec chmod 755 {} \; To select directories and subdirectories use the following syntax: $ find /home/user/demo -type d -perm 777 -print -exec chmod 755 {} \;]]></description>
				<content:encoded><![CDATA[<p>To find all files in /home/user/demo directory, enter:</p>
<p><code>$ find /home/user/demo -type f -print</code></p>
<p>To find all files in /home/user/demo directory with permission 777, enter:</p>
<p><code>$ find /home/user/demo -type f -perm 777 -print<br />
</code><br />
Finally, apply new permission using the -exec option as follows:</p>
<p><code>$ find /home/user/demo -type f -perm 777 -print -exec chmod 755 {} \;</code></p>
<p>To select directories and subdirectories use the following syntax:</p>
<p><code>$ find /home/user/demo -type d -perm 777 -print -exec chmod 755 {} \;</code></p>
]]></content:encoded>
			<wfw:commentRss>https://www.nikeshshk.com.np/news/find-and-change-file-permissions-recursively-linux-unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>extract .xz format Linux</title>
		<link>https://www.nikeshshk.com.np/news/extract-xz-format-linux/</link>
		<comments>https://www.nikeshshk.com.np/news/extract-xz-format-linux/#comments</comments>
		<pubDate>Sun, 15 Dec 2013 05:10:47 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.nikeshshk.com.np/?p=595</guid>
		<description><![CDATA[If the file is just something.xz (without .tar) then use unxz something.xz Otherwise use *.tar.bz2) tar xvjf filename.tar.bz2) ;; *.tar.gz) tar xvzf filename.tar.gz) ;; *.tar.xz) tar Jxvf filename.tar.xz) ;; *.bz2) bunzip2 filename.bz2) ;; *.rar) unrar filename.rar) ;; *.gz) gunzip filename.gz) ;; *.tar) tar xvf filename.tar) ;; *.tbz2) tar xvjf filename.tbz2) ;; *.tgz) tar xvzf filename.tgz) ;; *.zip) unzip filename.zip) ;; *.Z) uncompress filename.Z) ;; *.7z) 7z filename.7z) ;; &#160;]]></description>
				<content:encoded><![CDATA[<p>If the file is just something.xz (without .tar) then use</p>
<pre>unxz something.xz</pre>
<p>Otherwise use</p>
<pre>*.tar.bz2)	tar xvjf filename.tar.bz2) ;;
*.tar.gz)	tar xvzf filename.tar.gz) ;;
*.tar.xz)	tar Jxvf filename.tar.xz) ;;
*.bz2)		bunzip2 filename.bz2) ;;
*.rar)		unrar filename.rar) ;;
*.gz)		gunzip filename.gz) ;;
*.tar)		tar xvf filename.tar) ;;
*.tbz2)		tar xvjf filename.tbz2) ;;
*.tgz)		tar xvzf filename.tgz) ;;
*.zip)		unzip filename.zip) ;;
*.Z)		uncompress filename.Z) ;;
*.7z)		7z filename.7z) ;;</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.nikeshshk.com.np/news/extract-xz-format-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete Files Older Than x Days on Linux</title>
		<link>https://www.nikeshshk.com.np/news/delete-files-older-than-x-days-on-linux/</link>
		<comments>https://www.nikeshshk.com.np/news/delete-files-older-than-x-days-on-linux/#comments</comments>
		<pubDate>Wed, 20 Nov 2013 12:11:45 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.nikeshshk.com.np/?p=473</guid>
		<description><![CDATA[Delete Files Older Than x Days on Linux The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them. &#160; Command Syntax find /path/to/files* -mtime +5 -exec rm {} \; Note that there are spaces between rm, {}, and \; Explanation The first argument is the path to the files. This can be a path, a directory, or a wildcard as in the example above. I would recommend using the full path, and make sure that you run the command without the exec rm to make sure you are getting the right results. The second argument, -mtime, is used to specify the number of days old that the file is. If you enter +5, it will find files older than 5 days.&#160;<a href="https://www.nikeshshk.com.np/news/delete-files-older-than-x-days-on-linux/" class="read-more">Continue Reading</a>]]></description>
				<content:encoded><![CDATA[<p><strong>Delete Files Older Than x Days on Linux</strong></p>
<p>The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them.</p>
<p>&nbsp;</p>
<p><strong>Command Syntax</strong></p>
<blockquote><p>find /path/to/files* -mtime +5 -exec rm {} \;</p></blockquote>
<p>Note that there are spaces between rm, {}, and \;</p>
<p><strong>Explanation</strong></p>
<ul>
<li>The first argument is the path to the files. This can be a path, a directory, or a wildcard as in the example above. I would recommend using the full path, and make sure that you run the command without the exec rm to make sure you are getting the right results.</li>
<li>The second argument, -mtime, is used to specify the number of days old that the file is. If you enter +5, it will find files older than 5 days.</li>
<li>The third argument, -exec, allows you to pass in a command such as rm. The {} \; at the end is required to end the command.</li>
</ul>
<p>This should work on Ubuntu, Suse, Redhat, or pretty much any version of linux.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.nikeshshk.com.np/news/delete-files-older-than-x-days-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
