<?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>Kavoir &#187; Linux Server Administration Tips</title>
	<atom:link href="http://www.kavoir.com/category/manage-your-own-server/linux-server-administration-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://www.kavoir.com</link>
	<description>Just another dumbass webmaster, goofing around...</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:59:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Linux: How to delete / remove hidden files with &#8216;rm&#8217; command?</title>
		<link>http://www.kavoir.com/2011/02/linux-how-to-delete-remove-hidden-files-with-rm-command.html</link>
		<comments>http://www.kavoir.com/2011/02/linux-how-to-delete-remove-hidden-files-with-rm-command.html#comments</comments>
		<pubDate>Sat, 12 Feb 2011 09:41:35 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2011/02/linux-how-to-delete-remove-hidden-files-with-rm-command.html</guid>
		<description><![CDATA[To delete all content in any directory, including all sub-directories and files, I’ve been using this: rm -rf somedir/* If it is to delete all content of the current directory: rm -rf * However, it turns out ‘rm -rf’ doesn’t remove hidden files such as .htaccess (Files with a name starting with a dot are [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>To delete all content in any directory, including all sub-directories and files, I’ve been using this:</p>

<pre><code>rm -rf somedir/*</code></pre>
<p>If it is to delete all content of the current directory:</p>
<pre><code>rm -rf *</code></pre>
<p>However, it turns out ‘rm -rf’ doesn’t remove hidden files such as .htaccess (Files with a name starting with a dot are hidden in Linux). To delete all the hidden files as well, I have to run a 2nd command:</p>
<pre><code>rm -rf .??*</code></pre>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/08/linux-how-to-find-all-the-files-containing-a-particular-text-string.html" rel="bookmark" title="August 27, 2009">Linux: How to find all the files containing a particular text string?</a></li>
<li><a href="http://www.kavoir.com/2009/09/linux-check-how-much-disk-storage-each-directory-takes-up-disk-usage-command-du.html" rel="bookmark" title="September 2, 2009">Linux: Check how much disk storage each directory takes up (Disk Usage command &#8211; du)</a></li>
<li><a href="http://www.kavoir.com/2007/03/essential-ssh.html" rel="bookmark" title="March 29, 2007">Essential SSH &#8211; 19 Linux SSH Commands You Simply Cannot Live Without</a></li>
<li><a href="http://www.kavoir.com/2009/09/linux-find-files-changed-or-modified-within-1-day-or-lder-than-1-day.html" rel="bookmark" title="September 9, 2009">Linux: Find files changed or modified within 1 day or older than 1 day</a></li>
<li><a href="http://www.kavoir.com/2009/09/safely-and-quickly-transfer-files-between-your-hosts-hosting-accounts-servers-with-scp-command.html" rel="bookmark" title="September 18, 2009">scp, rsync: Safely and Quickly Transfer Files between Your Hosts / Hosting Accounts / Servers on SSH tunnel</a></li>
</ul>
<p><!-- Similar Posts took 2.250 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2011/02/linux-how-to-delete-remove-hidden-files-with-rm-command.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux: How to &#8216;find&#8217; and search ONLY text files?</title>
		<link>http://www.kavoir.com/2011/01/linux-how-to-find-only-text-files.html</link>
		<comments>http://www.kavoir.com/2011/01/linux-how-to-find-only-text-files.html#comments</comments>
		<pubDate>Sat, 22 Jan 2011 13:30:25 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2011/01/linux-how-to-find-only-text-files.html</guid>
		<description><![CDATA[The ‘find’ command in Linux systems searches through a directory and return files that satisfy certain criteria. For instance, to find a file that contains the string ‘needle text’ in the ‘mydocs’ directory: find mydocs -type f -exec grep -l "needle text" {} \; The problem of this approach is that it would search through ALL files [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The ‘find’ command in Linux systems searches through a directory and return files that satisfy certain criteria. For instance, to find a file that contains the string ‘needle text’ in the ‘mydocs’ directory:<span id="more-2138"></span></p>
<pre><code>find mydocs -type f -exec grep -l "needle text" {} \;</code></pre>
<p>The problem of this approach is that it would search through ALL files in this directory including the binary ones such as images, executables and zip packages. Sensibly, we would <strong>only</strong> want to search through text files for a specific string. If there are far too many of binary files in present, it’d be a significant waste of CPU usage and time to get what you want, because it’s totally unnecessary to go through the binary files.</p>
<p>To achieve this, use this version of the above command:</p>
<pre><code>find mydocs -type f -exec grep -l "needle text" {} \; <strong>-exec file {} \; | grep text | cut -d ':' -f1</strong></code></pre>
<p>I asked the question at <a href="http://stackoverflow.com/">stackoverflow.com</a> and <a href="http://stackoverflow.com/users/300805/peoro">peoro</a> came up with this solution. It works great.</p>
<p>Basically, the bold part checks each file’s mime type information and only searches the files that have ‘text’ in its mime type description. According to the Linux ‘file’ command manual, we can be fairly sure that files with ‘text’ in its mime type string are text files AND all text files have &#8216;text&#8217; in its mime type description string.<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/08/linux-how-to-find-all-the-files-containing-a-particular-text-string.html" rel="bookmark" title="August 27, 2009">Linux: How to find all the files containing a particular text string?</a></li>
<li><a href="http://www.kavoir.com/2011/12/php-get-mime-type-of-a-file-and-encoding.html" rel="bookmark" title="December 25, 2011">PHP: Get Mime Type of a File (and Encoding)</a></li>
<li><a href="http://www.kavoir.com/2009/04/what-is-this-linux-command.html" rel="bookmark" title="April 14, 2009">What is this Linux command?</a></li>
<li><a href="http://www.kavoir.com/2009/01/php-run-html-as-php.html" rel="bookmark" title="January 19, 2009">PHP: Run HTML as PHP</a></li>
<li><a href="http://www.kavoir.com/2008/11/how-to-count-files-get-the-number-of-files-under-a-directory-in-linux.html" rel="bookmark" title="November 18, 2008">How to count files (get the number of files) under a directory in Linux?</a></li>
</ul>
<p><!-- Similar Posts took 2.443 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2011/01/linux-how-to-find-only-text-files.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Use stat command to display file system meta information of any file or directory under Linux</title>
		<link>http://www.kavoir.com/2010/02/use-stat-command-to-display-detailed-meta-information-of-any-file-or-directory-under-linux.html</link>
		<comments>http://www.kavoir.com/2010/02/use-stat-command-to-display-detailed-meta-information-of-any-file-or-directory-under-linux.html#comments</comments>
		<pubDate>Fri, 19 Feb 2010 16:34:41 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Hosting Tips & Deals]]></category>
		<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2010/02/use-stat-command-to-display-detailed-meta-information-of-any-file-or-directory-under-linux.html</guid>
		<description><![CDATA[PHP has a stat() function that returns an array containing the meta information of a file such as owner, size, time of last access, last modification or last change. It’s basically the stat command under Linux that returns and shows the file system meta information of any file or directory: stat myfile.txt Which returns: File: [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>PHP has a stat() function that returns an array containing the meta information of a file such as owner, size, time of last access, last modification or last change. It’s basically the <strong>stat</strong> command under Linux that returns and shows the file system meta information of any file or directory:</p>

<pre><code><strong>stat</strong> myfile.txt</code></pre>
<p>Which returns:</p>
<pre><code>  File: `myfile.txt'
  Size: 1707            Blocks: 8          IO Block: 4096   regular file
Device: 811h/2065d      Inode: 96909802    Links: 1
Access: (0644/-rw-r--r--)  Uid: (1354144/    voir)   Gid: (255747/pg940032)
Access: 2010-02-16 08:00:00.000000000 -0800
Modify: 2010-02-18 04:16:51.000000000 -0800
Change: 2010-02-18 04:16:51.000000000 -0800</code></pre>
<p>To get the meta information of the current working directory:</p>
<pre><code><strong>stat</strong> .</code></pre>
<p>Which returns:</p>
<pre><code>  File: `.'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 811h/2065d      Inode: 96904945    Links: 4
Access: (0755/drwxr-xr-x)  Uid: (1354144/    voir)   Gid: (255747/pg940032)
Access: 2009-08-31 17:07:16.000000000 -0700
Modify: 2009-12-20 05:18:57.000000000 -0800
Change: 2009-12-20 05:18:57.000000000 -0800</code></pre>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/06/linux-php-differences-between-file-modification-time-filemtime-and-file-change-time-filectime.html" rel="bookmark" title="June 2, 2009">Linux, PHP: Differences between File Modification Time: filemtime() and File Change Time: filectime()</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-get-file-size.html" rel="bookmark" title="April 22, 2009">PHP: Get File Size</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-change-current-working-directory.html" rel="bookmark" title="April 22, 2009">PHP: Change Current Working Directory</a></li>
<li><a href="http://www.kavoir.com/2009/04/linux-the-differences-between-file-times-atime-accessed-time-ctime-changed-time-and-mtime-modified-time.html" rel="bookmark" title="April 22, 2009">Linux: The differences between file times: atime (accessed time), ctime (changed time) and mtime (modified time).</a></li>
<li><a href="http://www.kavoir.com/2009/09/linux-change-directory-or-cd-to-the-previous-directory-last-path.html" rel="bookmark" title="September 5, 2009">Linux: Change Directory or CD to the Previous Directory / Last Path</a></li>
</ul>
<p><!-- Similar Posts took 3.724 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2010/02/use-stat-command-to-display-detailed-meta-information-of-any-file-or-directory-under-linux.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux: How to open and extract an RAR zipped file and unrar the archive?</title>
		<link>http://www.kavoir.com/2009/09/linux-how-to-open-and-extract-an-rar-zipped-file-or-unrar-the-archive.html</link>
		<comments>http://www.kavoir.com/2009/09/linux-how-to-open-and-extract-an-rar-zipped-file-or-unrar-the-archive.html#comments</comments>
		<pubDate>Sat, 19 Sep 2009 03:29:32 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Hosting Tips & Deals]]></category>
		<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/09/linux-how-to-open-and-extract-an-rar-zipped-file-or-unrar-the-archive.html</guid>
		<description><![CDATA[Funny I should use “zipped” for an RAR compressed package. Anyway, you can easily zip or unzip a zip file or tar compress a package, but how does one do it with an RAR file? WinRAR is well distributed across all Windows systems. But on Linux, you have to first install the command package rar. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Funny I should use “zipped” for an RAR compressed package. Anyway, you can easily <a href="http://www.kavoir.com/2009/05/php-compress-files-into-tar-or-zip-make-a-zip-file-or-tar-file-with-php.html">zip or unzip a zip file or tar compress a package</a>, but how does one do it with an RAR file? WinRAR is well distributed across all Windows systems. But on Linux, you have to first install the command package <strong>rar</strong>.</p>

<p>However, if your host has been around for quite some time such as DreamHost, you will not need to install it yourself as it&#8217;s come with the system. Just fire up this command to unrar any RAR archives:</p>
<pre><code>rar x myfiles.rar</code></pre>
<p>Which will then extract all the data from <strong>myfiles.rar</strong> into the current working directory.</p>
<p>There are other commands you can rely on to achieve the same task though, depending on your host and the server distribution. For example, you may have <strong>unrar</strong> instead of <strong>rar</strong>. Other than these, you may also find RAR related installation packages on Debian and Ubuntu by:</p>
<pre><code>aptitude search unrar</code></pre>
<p>It will search and show you related available packages:</p>
<pre><code>p   unrar-free                           - Unarchiver for .rar files</code></pre>
<p>Which is another utility to unrar any RAR files on Linux. Just install it by <code>aptitude install unrar-free</code> and use to unpackage the compressed RAR.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2011/01/linux-how-to-find-only-text-files.html" rel="bookmark" title="January 22, 2011">Linux: How to &#8216;find&#8217; and search ONLY text files?</a></li>
<li><a href="http://www.kavoir.com/2009/12/how-to-install-the-go-programming-language-on-your-vps.html" rel="bookmark" title="December 28, 2009">How to install the Go programming language on your server or VPS?</a></li>
<li><a href="http://www.kavoir.com/2009/04/what-is-this-linux-command.html" rel="bookmark" title="April 14, 2009">What is this Linux command?</a></li>
<li><a href="http://www.kavoir.com/2009/06/where-is-phpini-located.html" rel="bookmark" title="June 1, 2009">Where is php.ini located?</a></li>
<li><a href="http://www.kavoir.com/2010/07/how-to-execute-php-scripts-in-the-background.html" rel="bookmark" title="July 18, 2010">How to execute / run PHP scripts in the background?</a></li>
</ul>
<p><!-- Similar Posts took 2.630 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/09/linux-how-to-open-and-extract-an-rar-zipped-file-or-unrar-the-archive.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>scp, rsync: Safely and Quickly Transfer Files between Your Hosts / Hosting Accounts / Servers on SSH tunnel</title>
		<link>http://www.kavoir.com/2009/09/safely-and-quickly-transfer-files-between-your-hosts-hosting-accounts-servers-with-scp-command.html</link>
		<comments>http://www.kavoir.com/2009/09/safely-and-quickly-transfer-files-between-your-hosts-hosting-accounts-servers-with-scp-command.html#comments</comments>
		<pubDate>Fri, 18 Sep 2009 08:37:34 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[HTTP Tips & Tutorials]]></category>
		<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/09/safely-and-quickly-transfer-files-between-your-hosts-hosting-accounts-servers-with-scp-command.html</guid>
		<description><![CDATA[Chances are you have a bunch of different hosts that are housing your website files, for the sake of data safety (never put all eggs in a single basket) and possibly some SEO advantage. If that is the case, you will infrequently come to the need to move some files from one host server to [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Chances are you have a bunch of different hosts that are housing your website files, for the sake of data safety (never put all eggs in a single basket) and possibly some SEO advantage. If that is the case, you will infrequently come to the need to move some files from one host server to another. How does one do that?</p>

<p>Well the straight answers include downloading the files from the source host and then uploading it to destination one via FTP. It’s not much of a time-waster with small number of files, especially those small in size. However, if it’s an impressively large chunk of package, say, 4GB, or thousands of files, this’d be quite a daunting job that may very well take the better part of your day or even a few days.</p>
<p>The shortcut is to transfer those files directly from the original host to the other, via SSH. That is of course, if you have both hosts enabled with SSH.</p>
<h2>scp Command</h2>
<p>Log into the destination host via SSH and try the following command:</p>
<pre><code><strong>scp</strong> -r remoteuser@remote.host.com:/home/remoteuser/dir-to-be-transferred/. /home/localuser/backup</code></pre>
<p>Wherein <strong>remote.host.com</strong> is the address of the source host and <strong>remoteuser</strong> is the SSH user (shell user) account that can read the remote directory to be transferred, namely <strong>/home/remoteuser/dir-to-be-transferred</strong>. The last argument is the local path that’s receiving the incoming files / directory.</p>
<p>The dot at the end of dir-to-be-transferred makes sure that all hidden files such as .htaccess are copied as well. Without the current directory sign (dot), hidden files are NOT copied by default.</p>
<p>You can also transfer a specific file:</p>
<pre><code><strong>scp</strong> remoteuser@remote.host.com:/home/remoteuser/mybackup.tar.gz /home/localuser/backup</code></pre>
<p>As a matter of fact, <strong>scp</strong> works the exactly same way as an ordinary <a href="http://www.kavoir.com/2009/04/php-copying-renaming-and-moving-a-file.html"><strong>cp</strong> command</a> except it’s able to copy files back and forth remote hosts. The “<strong>s</strong>” of “scp” stands for <strong>safe</strong>, because all the data transferred is encrypted on SSH.</p>
<p>It’s a great way to back up your valuable website data across multiple different hosts that are physically far away from each other. With the help of crontab jobs that do the regular backups automatically, this is even better than some of the commercial backup services.</p>
<h2>rsync Command</h2>
<p>The command of <strong>rsync</strong> is a more preferable option to <strong>scp</strong> for synchronizing stuff across different hosts because it compares differences and works incrementally, thus saving bandwidth, especially with large backups. For examples,</p>
<pre><code><strong>rsync</strong> -av --progress remoteuser@remote.host.com:/home/remoteuser/dir-to-be-transferred /home/localuser/backup</code></pre>
<p>This would copy and transfer the directory <strong>dir-to-be-transferred</strong> with all its content into <strong>backup</strong> so that <strong>dir-to-be-transferred</strong> is a sub-directory of <strong>backup</strong>.</p>
<pre><code><strong>rsync</strong> -av --progress remoteuser@remote.host.com:/home/remoteuser/dir-to-be-transferred/. /home/localuser/backup</code></pre>
<p>With an extra <strong>/.</strong> at the end of the source directory, only the content of the directory <strong>dir-to-be-transferred</strong> are copied and transferred into <strong>backup</strong>. Thus all the content of the directory <strong>dir-to-be-transferred</strong> are now immediate children of <strong>backup</strong>.</p>
<p>To specify the SSH port, such as 8023, just add:</p>
<pre><code> --rsh='ssh -p8023'</code></pre>
<p><strong>rsync</strong> automatically takes care of all hidden files, so there&#8217;s no need to add a dot at the end of the source directory.<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/09/dropbox-review-the-most-intuitive-online-backup-storage-data-synchronizing-and-files-sharing-application.html" rel="bookmark" title="September 23, 2009">Dropbox review – the most intuitive online backup storage, data synchronizing and files sharing software</a></li>
<li><a href="http://www.kavoir.com/2011/02/linux-how-to-delete-remove-hidden-files-with-rm-command.html" rel="bookmark" title="February 12, 2011">Linux: How to delete / remove hidden files with &lsquo;rm&rsquo; command?</a></li>
<li><a href="http://www.kavoir.com/2007/03/essential-ssh.html" rel="bookmark" title="March 29, 2007">Essential SSH &#8211; 19 Linux SSH Commands You Simply Cannot Live Without</a></li>
<li><a href="http://www.kavoir.com/2009/10/free-2gb-html-static-web-pages-hosting.html" rel="bookmark" title="October 7, 2009">Free 2GB HTML static web pages hosting</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-change-current-working-directory.html" rel="bookmark" title="April 22, 2009">PHP: Change Current Working Directory</a></li>
</ul>
<p><!-- Similar Posts took 2.861 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/09/safely-and-quickly-transfer-files-between-your-hosts-hosting-accounts-servers-with-scp-command.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux: Find files changed or modified within 1 day or older than 1 day</title>
		<link>http://www.kavoir.com/2009/09/linux-find-files-changed-or-modified-within-1-day-or-lder-than-1-day.html</link>
		<comments>http://www.kavoir.com/2009/09/linux-find-files-changed-or-modified-within-1-day-or-lder-than-1-day.html#comments</comments>
		<pubDate>Wed, 09 Sep 2009 09:08:10 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/09/linux-find-files-changed-or-modified-within-1-day-or-lder-than-1-day.html</guid>
		<description><![CDATA[One of the utility commands of Linux that you should know in the first day of your Linux learning seminar is find. To search recursively in the directory somedir for files changed / created / modified within 1 day: find somedir -ctime -1 To search recursively in the directory somedir for files changed changed / [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>One of the utility commands of Linux that you should know in the first day of your Linux learning seminar is <code>find</code>.</p>

<p>To search recursively in the directory somedir for files <a href="http://www.kavoir.com/2009/04/linux-the-differences-between-file-times-atime-accessed-time-ctime-changed-time-and-mtime-modified-time.html">changed / created / modified</a> within 1 day:</p>
<pre><code>find somedir -ctime -1</code></pre>
<p>To search recursively in the directory somedir for files changed changed / created / modified more than 1 days ago:</p>
<pre><code>find somedir -ctime +1</code></pre>
<p>To search recursively in the directory somedir for files modified within 1 day:</p>
<pre><code>find somedir -mtime -1</code></pre>
<p>To search recursively in the directory somedir for files modified more than 1 days ago:</p>
<pre><code>find somedir -mtime +1</code></pre>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/08/linux-how-to-find-all-the-files-containing-a-particular-text-string.html" rel="bookmark" title="August 27, 2009">Linux: How to find all the files containing a particular text string?</a></li>
<li><a href="http://www.kavoir.com/2009/04/linux-the-differences-between-file-times-atime-accessed-time-ctime-changed-time-and-mtime-modified-time.html" rel="bookmark" title="April 22, 2009">Linux: The differences between file times: atime (accessed time), ctime (changed time) and mtime (modified time).</a></li>
<li><a href="http://www.kavoir.com/2009/09/linux-check-how-much-disk-storage-each-directory-takes-up-disk-usage-command-du.html" rel="bookmark" title="September 2, 2009">Linux: Check how much disk storage each directory takes up (Disk Usage command &#8211; du)</a></li>
<li><a href="http://www.kavoir.com/2009/09/linux-how-to-open-and-extract-an-rar-zipped-file-or-unrar-the-archive.html" rel="bookmark" title="September 19, 2009">Linux: How to open and extract an RAR zipped file and unrar the archive?</a></li>
<li><a href="http://www.kavoir.com/2011/01/linux-how-to-find-only-text-files.html" rel="bookmark" title="January 22, 2011">Linux: How to &#8216;find&#8217; and search ONLY text files?</a></li>
</ul>
<p><!-- Similar Posts took 2.674 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/09/linux-find-files-changed-or-modified-within-1-day-or-lder-than-1-day.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux: Change Directory or CD to the Previous Directory / Last Path</title>
		<link>http://www.kavoir.com/2009/09/linux-change-directory-or-cd-to-the-previous-directory-last-path.html</link>
		<comments>http://www.kavoir.com/2009/09/linux-change-directory-or-cd-to-the-previous-directory-last-path.html#comments</comments>
		<pubDate>Sat, 05 Sep 2009 01:54:11 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Hosting Tips & Deals]]></category>
		<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/09/linux-change-directory-or-cd-to-the-previous-directory-last-path.html</guid>
		<description><![CDATA[cd is the command in Linux to change the current working directory. While you can change to your home directory by cd ~, you can change to the previous directory or last directory you were in by: cd - Which would come very handy when you are working across multiple directories back and forth. To [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><code>cd</code> is the command in Linux to change the current working directory. While you can change to your home directory by <code>cd ~</code>, you can change to the previous directory or last directory you were in by:</p>

<pre><code>cd -</code></pre>
<p>Which would come very handy when you are working across multiple directories back and forth. To change to the second last directory in the path history, simply add a slash:</p>
<pre><code>cd --</code></pre>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/php-change-current-working-directory.html" rel="bookmark" title="April 22, 2009">PHP: Change Current Working Directory</a></li>
<li><a href="http://www.kavoir.com/2009/09/linux-check-how-much-disk-storage-each-directory-takes-up-disk-usage-command-du.html" rel="bookmark" title="September 2, 2009">Linux: Check how much disk storage each directory takes up (Disk Usage command &#8211; du)</a></li>
<li><a href="http://www.kavoir.com/2007/03/essential-ssh.html" rel="bookmark" title="March 29, 2007">Essential SSH &#8211; 19 Linux SSH Commands You Simply Cannot Live Without</a></li>
<li><a href="http://www.kavoir.com/2011/05/php-explore-display-contents-of-directory-recursively.html" rel="bookmark" title="May 10, 2011">PHP: Display Files and Sub-directories of A Directory Recursively as A Tree</a></li>
<li><a href="http://www.kavoir.com/2009/04/what-is-this-linux-command.html" rel="bookmark" title="April 14, 2009">What is this Linux command?</a></li>
</ul>
<p><!-- Similar Posts took 2.659 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/09/linux-change-directory-or-cd-to-the-previous-directory-last-path.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux: Check how much disk storage each directory takes up (Disk Usage command &#8211; du)</title>
		<link>http://www.kavoir.com/2009/09/linux-check-how-much-disk-storage-each-directory-takes-up-disk-usage-command-du.html</link>
		<comments>http://www.kavoir.com/2009/09/linux-check-how-much-disk-storage-each-directory-takes-up-disk-usage-command-du.html#comments</comments>
		<pubDate>Wed, 02 Sep 2009 10:00:56 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Hosting Tips & Deals]]></category>
		<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/09/linux-check-how-much-disk-storage-each-directory-takes-up-disk-usage-command-du.html</guid>
		<description><![CDATA[The Linux command du stands for disk usage which is used to check the amount of disk storage any particular directory or file is using. By default, the simple command: du Would return the disk usage in God-knows-what-unit of each of the directories in the current working directory and those beneath them – in a [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The Linux command <strong>du</strong> stands for disk usage which is used to check the amount of disk storage any particular directory or file is using. By default, the simple command:</p>

<pre><code>du</code></pre>
<p>Would return the disk usage in God-knows-what-unit of each of the directories in the current working directory and those beneath them – in a recursive manner. If you happen to have lots of them, the returned stats would be scrolling down crazily which barely makes it any useful.</p>
<p>Even if you have specified a specific directory such as &quot;somedir&quot;:</p>
<pre><code>du somedir</code></pre>
<p>It still works in this uncomfortable way.</p>
<p>The solution is to use the <code>-sh</code> switch, the one switch a beginner will ever need:</p>
<pre><code>du -<strong>sh</strong></code></pre>
<p>Which simply returns the amount of disk space the current directory and all those stuff in it are using as a whole, something like:</p>
<pre><code>2.4G</code></pre>
<p>Much much more intuitive and readable.</p>
<p>By:</p>
<pre><code>du -sh somedir</code></pre>
<p>You can find out how much disk storage directory &quot;somedir&quot; is using:</p>
<pre><code>101M    somedir</code></pre>
<p>To get all the subsequent / child directories disk usage from the current directory, simply use the asterisk:</p>
<pre><code>du -sh <strong>*</strong></code></pre>
<p>It will then list the disk usage of all of them (but not recursively) one by one in a very readable manner:</p>
<pre><code>8.0K    dir1
1.4G    dir2
135M    dir3</code></pre>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/08/linux-how-to-find-all-the-files-containing-a-particular-text-string.html" rel="bookmark" title="August 27, 2009">Linux: How to find all the files containing a particular text string?</a></li>
<li><a href="http://www.kavoir.com/2009/09/linux-find-files-changed-or-modified-within-1-day-or-lder-than-1-day.html" rel="bookmark" title="September 9, 2009">Linux: Find files changed or modified within 1 day or older than 1 day</a></li>
<li><a href="http://www.kavoir.com/2008/11/how-to-count-files-get-the-number-of-files-under-a-directory-in-linux.html" rel="bookmark" title="November 18, 2008">How to count files (get the number of files) under a directory in Linux?</a></li>
<li><a href="http://www.kavoir.com/2007/03/essential-ssh.html" rel="bookmark" title="March 29, 2007">Essential SSH &#8211; 19 Linux SSH Commands You Simply Cannot Live Without</a></li>
<li><a href="http://www.kavoir.com/2009/09/linux-change-directory-or-cd-to-the-previous-directory-last-path.html" rel="bookmark" title="September 5, 2009">Linux: Change Directory or CD to the Previous Directory / Last Path</a></li>
</ul>
<p><!-- Similar Posts took 2.750 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/09/linux-check-how-much-disk-storage-each-directory-takes-up-disk-usage-command-du.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Linux: How to find all the files containing a particular text string?</title>
		<link>http://www.kavoir.com/2009/08/linux-how-to-find-all-the-files-containing-a-particular-text-string.html</link>
		<comments>http://www.kavoir.com/2009/08/linux-how-to-find-all-the-files-containing-a-particular-text-string.html#comments</comments>
		<pubDate>Thu, 27 Aug 2009 09:20:50 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/08/linux-how-to-find-all-the-files-containing-a-particular-text-string.html</guid>
		<description><![CDATA[At Linux command line, to find a particular text string in all the files from the current directory recursively (that is, including all those files from the child or grandchild directories), use something like this via SSH: find . -exec grep -l &#34;needle&#34; {} \; This command searches through all directories from the current directory [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>At Linux command line, to find a particular text string in all the files from the current directory recursively (that is, including all those files from the child or grandchild directories), use something like this via SSH:</p>

<p> <code>find . -exec grep -l &quot;needle&quot; {} \;</code>
<p>This command searches through all directories from the current directory recursively for the files that contain the string “needle”.</p>
<p>To search only .php files: </p>
<p><code>find *.php -exec grep -l &quot;needle&quot; {} \;</code></p>
<p>To search a specific directory: </p>
<p><code>find dirname -exec grep -l &quot;needle&quot; {} \;</code></p>
<p>To find all .php files that contain &#8220;needle&#8221; in all the directories under &#8220;somedir&#8221;:</p>
<p><code>find somedir -name *.php -exec grep -l "needle" {} \;</code></p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2011/01/linux-how-to-find-only-text-files.html" rel="bookmark" title="January 22, 2011">Linux: How to &#8216;find&#8217; and search ONLY text files?</a></li>
<li><a href="http://www.kavoir.com/2009/09/linux-check-how-much-disk-storage-each-directory-takes-up-disk-usage-command-du.html" rel="bookmark" title="September 2, 2009">Linux: Check how much disk storage each directory takes up (Disk Usage command &#8211; du)</a></li>
<li><a href="http://www.kavoir.com/2009/09/linux-find-files-changed-or-modified-within-1-day-or-lder-than-1-day.html" rel="bookmark" title="September 9, 2009">Linux: Find files changed or modified within 1 day or older than 1 day</a></li>
<li><a href="http://www.kavoir.com/2008/11/how-to-count-files-get-the-number-of-files-under-a-directory-in-linux.html" rel="bookmark" title="November 18, 2008">How to count files (get the number of files) under a directory in Linux?</a></li>
<li><a href="http://www.kavoir.com/2011/02/linux-how-to-delete-remove-hidden-files-with-rm-command.html" rel="bookmark" title="February 12, 2011">Linux: How to delete / remove hidden files with &lsquo;rm&rsquo; command?</a></li>
</ul>
<p><!-- Similar Posts took 2.869 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/08/linux-how-to-find-all-the-files-containing-a-particular-text-string.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux wget Command to Download and Mirror a Website in Static Local Copy</title>
		<link>http://www.kavoir.com/2009/08/linux-wget-command-to-download-and-mirror-a-website-in-static-local-copy.html</link>
		<comments>http://www.kavoir.com/2009/08/linux-wget-command-to-download-and-mirror-a-website-in-static-local-copy.html#comments</comments>
		<pubDate>Sun, 02 Aug 2009 08:46:57 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Hosting Tips & Deals]]></category>
		<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/08/linux-wget-command-to-download-and-mirror-a-website-in-static-local-copy.html</guid>
		<description><![CDATA[wget is such a wonderful command in Linux you can ever get. Consider blessed to have it in your SSH arsenal. Now, not only does it allow you to download something neatly from the command line to the current working directory – that’s why WordPress always puts the latest version of the blog script at [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><strong>wget</strong> is such a wonderful command in Linux you can ever get. Consider blessed to have it in your <a href="http://www.kavoir.com/2007/03/essential-ssh.html">SSH</a> arsenal. Now, not only does it allow you to download something neatly from the command line to the current working directory – that’s why WordPress always puts the latest version of the blog script at <a href="http://www.wordpress.org/latest.zip">http://www.wordpress.org/latest.zip</a>, that way you don’t even have to visit the site before using wget to get it in no hassle:</p>

<p> <code>wget http://www.wordpress.org/latest.zip</code>
<p>And the latest version of WordPress will be in your local working directory in no time – but it can also help you to create a local mirrored copy of a remote website for backup or for local browsing.</p>
<h3>How to Make Mirrors from a Site with wget command?</h3>
<p><strong>wget</strong> comes equipped with so many useful switches and features and one of them is to mirror stuff off the Internet, from online to offline. For example, you have a blogspot blog and you want a local copy of the entire blog files / web pages, including all those CSS style sheets, images and scripts. No problem, just go with</p>
<p> <code>wget <strong>-mk</strong> http://yours.blogspot.com</code>
<p>Don&#8217;t worry, <strong>wget</strong> will create a new directory named by the domain, in this case, &quot;yours.blogspot.com&quot;, to store all those files. After screens and screens of real-time logging, when it’s done, the local mirror should be ready to use.</p>
<p>The –m switch is short for –mirror and the –k switch translates all absolute URLs in the HTML into relative ones for totally offline browsing. </p>
<p>The problem is that <strong>wget</strong> works much better with sites using sanitized / clean URLs such as a WordPress blog. Though a blogspot blog is basically in static HTML, it contains quite some complicated URLs here and there that’s filled with parameters. The result doesn’t look too pretty.</p>
<p>However, after trying <strong>wget</strong> to recursively download and mirror a WordPress blog, it looks fantastic. Try it with a permalink enabled WordPress blog and it will surely amaze you.</p>
<p>It’s best used to generate mirrors of websites completely built in static files or sites with simple URL schemes.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/06/how-to-transfer-move-wordpress-blog-from-one-domain-to-another.html" rel="bookmark" title="June 15, 2009">How to Transfer / Move WordPress Blog from One Domain to Another</a></li>
<li><a href="http://www.kavoir.com/2008/11/how-to-count-files-get-the-number-of-files-under-a-directory-in-linux.html" rel="bookmark" title="November 18, 2008">How to count files (get the number of files) under a directory in Linux?</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-copying-renaming-and-moving-a-file.html" rel="bookmark" title="April 22, 2009">PHP: Copy, Rename or Move a File</a></li>
<li><a href="http://www.kavoir.com/2009/09/safely-and-quickly-transfer-files-between-your-hosts-hosting-accounts-servers-with-scp-command.html" rel="bookmark" title="September 18, 2009">scp, rsync: Safely and Quickly Transfer Files between Your Hosts / Hosting Accounts / Servers on SSH tunnel</a></li>
<li><a href="http://www.kavoir.com/2011/02/linux-how-to-delete-remove-hidden-files-with-rm-command.html" rel="bookmark" title="February 12, 2011">Linux: How to delete / remove hidden files with &lsquo;rm&rsquo; command?</a></li>
</ul>
<p><!-- Similar Posts took 3.103 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/08/linux-wget-command-to-download-and-mirror-a-website-in-static-local-copy.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to Recover or Reset MySQL root Password after You Forgot and Lost It</title>
		<link>http://www.kavoir.com/2009/06/reset-mysql-root-password-after-you-forgot-or-lost-it.html</link>
		<comments>http://www.kavoir.com/2009/06/reset-mysql-root-password-after-you-forgot-or-lost-it.html#comments</comments>
		<pubDate>Sat, 20 Jun 2009 15:16:50 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Linux Server Administration Tips]]></category>
		<category><![CDATA[SQL / MySQL Tips and Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=1113</guid>
		<description><![CDATA[MySQL has come with a safe mode wherein access privileges are not checked, which essentially enables you to log in anonymously to change anything in any database. And we are going to get in this safe mode to reset the lost MySQL root password. First, you need to stop the current MySQL daemon by: /etc/init.d/mysql [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>MySQL has come with a safe mode wherein access privileges are not checked, which essentially enables you to log in anonymously to change anything in any database.</p>

<p>And we are going to get in this safe mode to reset the lost MySQL root password.</p>
<ol>
<li>First, you need to stop the current MySQL daemon by:<br />
<code>/etc/init.d/mysql stop</code></li>
<li>Then you can start the safe mode of MySQL and skip privileges check by:<br />
<code>mysqld_safe --skip-grant-tables &#038;</code><br />
The &#038; in the end gets it to run in the background so we can continue to reset the root password.</li>
<li>Now you can log into the MySQL server anonymously (well not anonymously but without privilege check):<br />
<code>mysql --user=root mysql</code></li>
<li>And reset the root password by updating the user table of the mysql database:
<pre><code>UPDATE user SET Password=PASSWORD('newrootpwd') WHERE user='root';
FLUSH PRIVILEGES;</code></pre>
</li>
<li>Get out of the safe mode and restart the normal MySQL daemon:<br />
<code>/etc/init.d/mysql restart</code></li>
<li>At last, you should be able to connect to the database server by your new root password.</li>
</ol>
<p>As always, you will have to log in as <strong>root</strong> of the entire server or you won&#8217;t be able to stop the MySQL daemon and start the safe mode in the first place.</p>
<p>Note that I&#8217;m recovering the root password of MySQL in Ubuntu 9.04 Jaunty with MySQL installed by aptitude. Specific procedures may vary distribution by distribution but I&#8217;m sure the fundamental logic remains the same: getting in the safe mode to reset the root password.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/09/mysql-how-to-backup-all-databases-at-once-as-root-with-mysqldump.html" rel="bookmark" title="September 5, 2009">MySQL: How to backup ALL databases as root with mysqldump at once?</a></li>
<li><a href="http://www.kavoir.com/2011/09/ssh-web-hosting-as-socks5-proxy-for-vpn-tunnels-via-putty.html" rel="bookmark" title="September 30, 2011">SSH Web Hosting as Socks5 Proxy for VPN Tunnels via PuTTY</a></li>
<li><a href="http://www.kavoir.com/2008/12/backup-and-recover-a-mysql-database-under-command-line.html" rel="bookmark" title="December 14, 2008">Backup and recover a MySQL database under command line</a></li>
<li><a href="http://www.kavoir.com/2009/04/the-secure-way-to-store-passwords-with-php.html" rel="bookmark" title="April 20, 2009">The Secure Way to Store Passwords with PHP</a></li>
<li><a href="http://www.kavoir.com/2010/10/mysql-log-files-are-taking-a-lot-of-disk-space-how-to-disable-and-delete-them.html" rel="bookmark" title="October 25, 2010">MySQL log files are taking a lot of disk space &ndash; How to disable and delete them?</a></li>
</ul>
<p><!-- Similar Posts took 2.795 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/06/reset-mysql-root-password-after-you-forgot-or-lost-it.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux, PHP: Differences between File Modification Time: filemtime() and File Change Time: filectime()</title>
		<link>http://www.kavoir.com/2009/06/linux-php-differences-between-file-modification-time-filemtime-and-file-change-time-filectime.html</link>
		<comments>http://www.kavoir.com/2009/06/linux-php-differences-between-file-modification-time-filemtime-and-file-change-time-filectime.html#comments</comments>
		<pubDate>Tue, 02 Jun 2009 14:45:58 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Linux Server Administration Tips]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/06/linux-php-differences-between-file-modification-time-filemtime-and-file-change-time-filectime.html</guid>
		<description><![CDATA[In most Unix file systems, the modification time and the change time of a file may not necessarily be the same, they are actually 2 very distinct concepts to deal with: File modification time represents when the data blocks or content are changed or modified, not including that of meta data such as ownership or [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>In most Unix file systems, the modification time and the change time of a file may not necessarily be the same, they are actually 2 very distinct concepts to deal with:</p>

<ol>
<li><strong>File modification time</strong> represents when the data blocks or content are changed or modified, not including that of meta data such as ownership or ownergroup.</li>
<li><strong>File change time</strong> represents the time when the meta data or inode data of a file is altered, such as the change of permissions, ownership or group.</li>
</ol>
<p>Accordingly, PHP function <strong>filemtime()</strong> returns the time the content is modified or updated while function <strong>filectime()</strong> returns the time when the meta data is updated or changed.</p>
<p>When you need to display a web page last modification time, for example, you should use filemtime() because you want to show the time when the page content is updated.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/linux-the-differences-between-file-times-atime-accessed-time-ctime-changed-time-and-mtime-modified-time.html" rel="bookmark" title="April 22, 2009">Linux: The differences between file times: atime (accessed time), ctime (changed time) and mtime (modified time).</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-getting-last-changed-time-of-a-file-file-ctime.html" rel="bookmark" title="April 22, 2009">PHP: Getting Last Changed Time of a File &ndash; File ctime</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-getting-last-modification-time-of-a-file-file-mtime.html" rel="bookmark" title="April 22, 2009">PHP: Getting Last Modification Time of a File &ndash; File mtime</a></li>
<li><a href="http://www.kavoir.com/2010/02/use-stat-command-to-display-detailed-meta-information-of-any-file-or-directory-under-linux.html" rel="bookmark" title="February 20, 2010">Use stat command to display file system meta information of any file or directory under Linux</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-create-a-temporary-file.html" rel="bookmark" title="April 22, 2009">PHP: Create a Temporary File</a></li>
</ul>
<p><!-- Similar Posts took 2.626 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/06/linux-php-differences-between-file-modification-time-filemtime-and-file-change-time-filectime.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where is php.ini located?</title>
		<link>http://www.kavoir.com/2009/06/where-is-phpini-located.html</link>
		<comments>http://www.kavoir.com/2009/06/where-is-phpini-located.html#comments</comments>
		<pubDate>Mon, 01 Jun 2009 14:30:01 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Linux Server Administration Tips]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/06/where-is-phpini-located.html</guid>
		<description><![CDATA[Well it depends on the Linux distribution you are using, the version of php and the way you install it with Apache web server. Php.ini may be here: /etc/php.ini Or here: /etc/php/php.ini /etc/php5/php.ini Or here: /usr/bin/php5/bin/php.ini Anyway, you can always find any file named php.ini in this manner find / -name php.ini The simplest yet [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Well it depends on the Linux distribution you are using, the version of php and the way you install it with Apache web server. <strong>Php.ini</strong> may be here:</p>

<p><code>/etc/php.ini</code></p>
<p>Or here:</p>
<p><code>/etc/php/php.ini<br />
/etc/php5/php.ini</code></p>
<p>Or here:</p>
<p><code>/usr/bin/php5/bin/php.ini</code></p>
<p>Anyway, you can always <strong>find</strong> any file named php.ini in this manner</p>
<p><code><strong>find</strong> / -name php.ini</code></p>
<p>The simplest yet most powerful usage of the renowned <strong>find</strong> command. By its help I was able to locate the php.ini on my Ubuntu 9.04 Apache2 and PHP5:</p>
<p><code>/etc/php5/apache2/php.ini</code></p>
<h2>Use phpinfo() to find out</h2>
<p>Write a simple PHP file with the following content:</p>
<pre><code>&lt;?php phpinfo();</code></pre>
<p>And upload it to your server and access it in your web browser to get a page like this:</p>
<p><div id="attachment_2622" class="wp-caption alignnone" style="width: 300px">
	<a href="http://www.kavoir.com/wp-content/uploads/2009/06/php.ini_.png" rel="lightbox[914]" title="PHP configuration file php.ini path"><img class="size-medium wp-image-2622" title="PHP configuration file php.ini path" src="http://www.kavoir.com/wp-content/uploads/2009/06/php.ini_-300x217.png" alt="PHP configuration file php.ini path" width="300" height="217" /></a>
	<p class="wp-caption-text">PHP configuration file php.ini path</p>
</div><br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/09/linux-how-to-open-and-extract-an-rar-zipped-file-or-unrar-the-archive.html" rel="bookmark" title="September 19, 2009">Linux: How to open and extract an RAR zipped file and unrar the archive?</a></li>
<li><a href="http://www.kavoir.com/2009/06/php-open_basedir-in-phpini-to-limit-php-file-accesses-to-a-certain-directory.html" rel="bookmark" title="June 1, 2009">PHP: open_basedir in php.ini to Restrict and Limit PHP File Accesses to a Certain Directory</a></li>
<li><a href="http://www.kavoir.com/2010/04/css-how-to-write-css-rules-to-detect-or-target-chrome-safari-or-opera-browsers-only.html" rel="bookmark" title="April 1, 2010">CSS: How to write CSS rules to detect or target Chrome, Safari or Opera browsers only?</a></li>
<li><a href="http://www.kavoir.com/2010/07/how-to-execute-php-scripts-in-the-background.html" rel="bookmark" title="July 18, 2010">How to execute / run PHP scripts in the background?</a></li>
<li><a href="http://www.kavoir.com/2009/04/what-is-this-linux-command.html" rel="bookmark" title="April 14, 2009">What is this Linux command?</a></li>
</ul>
<p><!-- Similar Posts took 2.691 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/06/where-is-phpini-located.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Accidental Ctrl+S Locks and Freezes Linux Terminal / SSH / Telnet</title>
		<link>http://www.kavoir.com/2009/05/accidental-ctrls-locks-and-freezes-linux-terminal-ssh-telnet.html</link>
		<comments>http://www.kavoir.com/2009/05/accidental-ctrls-locks-and-freezes-linux-terminal-ssh-telnet.html#comments</comments>
		<pubDate>Tue, 26 May 2009 02:54:40 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/05/accidental-ctrls-locks-and-freezes-linux-terminal-ssh-telnet.html</guid>
		<description><![CDATA[Ctrl+S happens to be a rather handy and popular combination as it’s used in Windows applications to save your current working data. I accidentally used it several times in Vim and it keeps locking the screen up and halting the interactivity – basically, after Ctrl+S I can’t do anything to the terminal (window). I use [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Ctrl+S happens to be a rather handy and popular combination as it’s used in Windows applications to save your current working data. I accidentally used it several times in Vim and it keeps locking the screen up and halting the interactivity – basically, after Ctrl+S I can’t do anything to the terminal (window). I use PuTTY in Windows to access my Linux hosting via SSH.</p>

<p>A few lookups in Linux manuals reveal the secrets, the Ctrl+S key combination temporarily freezes the screen but the input is recorded though not dealt with. Once you press <strong>Ctrl+Q</strong>, it is unlocked and all the flood of input you have provided to the terminal takes immediate effect.</p>
<p>So, don’t panic when you accidentally pressed Ctrl+S and seemingly freezes everything, just press <strong>Ctrl+Q</strong> to exit it.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2010/04/javascript-confirmation-warning-before-leaving-or-navigating-away-from-a-page.html" rel="bookmark" title="April 27, 2010">JavaScript: Confirmation / Warning before Leaving or Navigating Away from a Page</a></li>
<li><a href="http://www.kavoir.com/2011/09/3-tips-for-zend-studio-8-eclipse.html" rel="bookmark" title="September 14, 2011">4 Tips for Zend Studio 8 (Eclipse)</a></li>
<li><a href="http://www.kavoir.com/2009/04/what-is-this-linux-command.html" rel="bookmark" title="April 14, 2009">What is this Linux command?</a></li>
<li><a href="http://www.kavoir.com/2009/12/a-basic-php-contact-form-script.html" rel="bookmark" title="December 10, 2009">A Simple PHP Contact Form Script</a></li>
<li><a href="http://www.kavoir.com/2011/02/mysql-how-to-export-a-database-table-to-xml.html" rel="bookmark" title="February 17, 2011">MySQL: How to export a database / table to XML?</a></li>
</ul>
<p><!-- Similar Posts took 2.655 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/05/accidental-ctrls-locks-and-freezes-linux-terminal-ssh-telnet.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change Vim syntax highlighting colors?</title>
		<link>http://www.kavoir.com/2009/05/how-to-change-vim-syntax-highlighting-colors.html</link>
		<comments>http://www.kavoir.com/2009/05/how-to-change-vim-syntax-highlighting-colors.html#comments</comments>
		<pubDate>Tue, 26 May 2009 02:35:38 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/2009/05/how-to-change-vim-syntax-highlighting-colors.html</guid>
		<description><![CDATA[Unbuntu has auto-configured Vim to use syntax highlighting for text (mostly, programs and configuration files of course) editing, the problem however, is that some of the colors appear to be darker than wanted on SSH console and it’s a little hard to recognize comfortably. So how can we change the default colors of the syntax [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Unbuntu has auto-configured Vim to use syntax highlighting for text (mostly, programs and configuration files of course) editing, the problem however, is that some of the colors appear to be darker than wanted on SSH console and it’s a little hard to recognize comfortably.</p>

<p>So how can we change the default colors of the syntax highlighting?</p>
<ol>
<li>Locate Vim configuration file which is located at <strong>/etc/vim/vimrc</strong>, add a line after ‘syntax on’: <strong>colorscheme desert</strong> </li>
<li>Now that we are prescribing Vim to use the syntax color scheme desert, we will want to find the scheme file to change the colors that we don’t feel comfortable with. The desert color scheme file is located at: <strong>/usr/share/vim/vimcurrent/colors/desert.vim</strong> </li>
<li>Proceed to open it with vi and replace the color values with new ones. For example, the default comment color may be a little too dark on a black screen, let’s make it lighter by changing      <br /> 
<pre><code>hi Comment      ctermfg=<strong>darkcyan</strong></code></pre>
<p>to </p>
<pre><code>hi Comment      ctermfg=<strong>blue</strong></code></pre>
</li>
<li>Reload the vimrc configuration file by performing ‘<strong>source /etc/vim/vimrc</strong>’ at shell. </li>
</ol>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2008/04/colorful-unix-bash-console-by-alias-and-bash_profile.html" rel="bookmark" title="April 19, 2008">Colorful Linux Bash Console by .alias and .bash_profile</a></li>
<li><a href="http://www.kavoir.com/2009/06/html-change-text-and-font-colors.html" rel="bookmark" title="June 16, 2009">HTML: Change Text and Font Colors</a></li>
<li><a href="http://www.kavoir.com/2010/07/how-to-bring-down-optimize-memory-usage-in-your-unmanaged-linux-vps-box-and-avoid-oom-out-of-memory-errors.html" rel="bookmark" title="July 1, 2010">How to bring down / optimize memory usage in your unmanaged Linux VPS box and avoid OOM (Out Of Memory) errors?</a></li>
<li><a href="http://www.kavoir.com/2012/01/customize-wordpress-post-editor-css-styles.html" rel="bookmark" title="January 19, 2012">Customize WordPress Post Editor CSS Styles</a></li>
<li><a href="http://www.kavoir.com/2010/10/mysql-change-default-character-set-or-default-collation-in-phpmyadmin.html" rel="bookmark" title="October 16, 2010">MySQL: Change Default Character Set or Default Collation in phpMyAdmin</a></li>
</ul>
<p><!-- Similar Posts took 2.703 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2009/05/how-to-change-vim-syntax-highlighting-colors.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

