<?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>Wowebmaster.com &#187; bash</title>
	<atom:link href="http://www.wowebmaster.com/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wowebmaster.com</link>
	<description>World of Webmaster: Sharing Experiences</description>
	<lastBuildDate>Wed, 27 May 2009 10:31:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Changing MySQL Database Character Set</title>
		<link>http://www.wowebmaster.com/mysql/mysql-character-set-change/</link>
		<comments>http://www.wowebmaster.com/mysql/mysql-character-set-change/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 23:19:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>

		<guid isPermaLink="false">http://www.wowebmaster.com/?p=22</guid>
		<description><![CDATA[MySQL Database Character Set Problem]]></description>
			<content:encoded><![CDATA[<p>You have probably come across with the mysql character set problem, If you are trying to implement a database in a language other than English. You are inserting rows with your text in your language, but you see invalid characters on your database, phpmyadmin mostly.</p>
<p>This is mostly because of character set defined in your mysql database is not proper for your language. This is usually UTF-8 Unicode, and it is default.</p>
<p><strong>Fix:</strong></p>
<p>Changing the charecter set can be done via mysql command line.  Just login to your server via SSH and bring your mysql command line on with following command.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p22code1'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p221"><td class="code" id="p22code1"><pre class="bash" style="font-family:monospace;"> mysql <span style="color: #660033;">-h</span>   <span style="color: #660033;">-D</span>   <span style="color: #660033;">-u</span>   <span style="color: #660033;">-p</span></pre></td></tr></table></div>

<p>Now it will ask you password before giving access to mysql prompt.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p22code2'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p222"><td class="code" id="p22code2"><pre class="bash" style="font-family:monospace;">ALTER DATABASE wowebmaster DEFAULT CHARACTER SET utf8 COLLATE utf8_turkish_ci \g</pre></td></tr></table></div>

<p>When you get access to mysql command line,  type the above mysql command, it will change the character set of <em>wowebmaster</em> database to utf8_turkish_ci . That&#8217;s it. Replace the database name and the character set for your own modifications.</p>
<p><strong>Update: Changing Table Character Set</strong></p>
<p>If you are looking for changing your table&#8217;s character set, you can use the following command;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p22code3'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p223"><td class="code" id="p22code3"><pre class="bash" style="font-family:monospace;">ALTER TABLE table_name DEFAULT CHARACTER SET utf8 COLLATE utf8_turkish_ci \g</pre></td></tr></table></div>

<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fwww.wowebmaster.com%2Fmysql%2Fmysql-character-set-change%2F&amp;linkname=Changing%20MySQL%20Database%20Character%20Set"><img src="http://www.wowebmaster.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.wowebmaster.com/mysql/mysql-character-set-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Bash Commands in Linux</title>
		<link>http://www.wowebmaster.com/linux/basic-bash-commands-in-linux/</link>
		<comments>http://www.wowebmaster.com/linux/basic-bash-commands-in-linux/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 11:56:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.wowebmaster.com/?p=8</guid>
		<description><![CDATA[A basic reference to bash commands used in Linux' command line.]]></description>
			<content:encoded><![CDATA[<p>This reference is prepared for webmasters to provide basic knowledge of bash linux commands. You should know these if you are thinking to move to a dedicated server or have already one.</p>
<p><strong>Mkdir &#8211; Make directories</strong>:</p>
<p>* <em>Options</em></p>
<ul>
<li>-m, mode=MODE  set permission mode (as in chmod), not rwxrwxrwx &#8211; umask</li>
<li>-p, parents  no error if existing, make parent directories as needed</li>
<li>-v, verbose  print a message for each created directory</li>
<li>-help display this help and exit</li>
<li>-version output version information and exit</li>
</ul>
<p>* <em>Usage</em><br />
<code>mkdir -m 777 folder1</code></p>
<p>Above code would create a directory named <em>folder1</em> which can be read, executed and written by all kind of users. The first digit represents the owner, the second represents the group and the third represents other users. The number 7 represents all three types of permission ( read, write and execute), 6 stands for read and write only, 5 stands for read and execute, 4 is read only, 3 is write and execute, 2 is write only, 1 is execute only and 0 is no permissions.</p>
<p><strong>Cd &#8211; Change Directories</strong>:</p>
<p>* <em>Usage</em></p>
<p><code>cd folder1</code><br />
The above command would change the current directory to directory named <em>folder1</em>.</p>
<p><code>cd ..</code><br />
The above command would go to parent directory of current directory.</p>
<p><code>cd /</code><br />
The above command would go to root directory regardless which directory you are in.</p>
<p>Mv &#8211; Move or Rename Directories &amp; Files:</p>
<p>* <em>Usage</em></p>
<p><code>move testfolder newfolder</code><br />
This command would move/rename <em>testfolder</em> to <em>newfolder</em>.</p>
<p><code>move * /newdir/</code><br />
The above command moves all files and directories in the current directory, including all the contents of those directories, from the current directory to the directory <em>/newdir/</em> .</p>
<p><strong>Pwd &#8211; Print Working Directory</strong>:<br />
It shows you the full path to the directory you are currently in.</p>
<p>* <em>Usage</em></p>
<p><code>pwd</code><br />
It would print the following line:<br />
<em>/home/server/mywebsite.com/</em></p>
<p><strong>Rm &#8211; Remove Directories</strong>:</p>
<p>* <em>Usage</em></p>
<p><code>rm install</code><br />
<em>Cannot Remove DIRECTORY Is A Directory</em><br />
If you are getting this error, just force it with this command.</p>
<p><code>rm -rf install</code><br />
The above command would remove the whole directory with files and directories in.</p>
<p><strong>Chmod &#8211; Change File Access Permissions</strong></p>
<p>* <em>Options</em><br />
-c, &#8211;changes: like verbose but report only when a change is made<br />
&#8211;no-preserve-root: do not treat `/&#8217; specially (the default)<br />
&#8211;preserve-root: fail to operate recursively on `/&#8217;<br />
-f, &#8211;silent, &#8211;quiet: suppress most error messages<br />
-v, verbose: output a diagnostic for every file processed<br />
&#8211;reference=RFILE: use RFILE&#8217;s mode instead of MODE values<br />
-R, &#8211;recursive: change files and directories recursively<br />
&#8211;help: display this help and exit<br />
&#8211;version: output version information and exit</p>
<p>* <em>Usage</em></p>
<p><code>chmod 644 index.htm</code><br />
The above command gives the file read/write by the owner and only read by everyone else.</p>
<p><em>Some Numerical Mod Presentations</em><br />
600 read and write by owner<br />
400 read by owner<br />
040 read by group<br />
004 read by anybody (other)<br />
200 write by owner<br />
020 write by group<br />
002 write by anybody<br />
100 execute by owner<br />
010 execute by group<br />
001 execute by anybody</p>
<p><strong>Ls &#8211; Short Listing of Directories &amp; Files</strong>:</p>
<p>* <em>Options</em><br />
-al: detailed listing of files and directories, showing permissions, ownership, size, and time and date stamp.</p>
<p>Just type <em>ls</em> on the command line, and you get the list of files and directories within your current directory.</p>
<p><strong>Cp &#8211; Copy Files</strong>:</p>
<p>* <em>Options</em><br />
-i: with this option, you will be prompted before overwriting the file.<br />
-dpr: copy preserving links (-d option), file attributes (-p option), and copy recursively (-r option)</p>
<p>* <em>Usage</em></p>
<p><code>cp -dpr folder1 folder2/</code><br />
The above code would copy the directory <em>folder1</em> with its contents, to the directory under <em>folder2</em>.</p>
<p><em>folder2</em> has now:<br />
<em><br />
anotherfile.html<br />
folder1<br />
</em></p>
<p><strong>Tar &amp; Bzip2 &#8211; Archive Compression &amp; Extraction</strong></p>
<p>* <em>Usage</em><br />
<code>tar -c folder/ | bzip2 &gt; folder.tar.bz2</code><br />
The above command compresses <em>folder</em> directory and the following command extracts the compressed archive.</p>
<p><code>bzip2 -dc folder.tar.bz2 | tar -x</code></p>
<p><strong>Gpg &#8211; Encryption &amp; Decryption of Files in Linux</strong></p>
<p>* <em>Usage</em><br />
To encrypt and decrypt files you can use the following command:<br />
<code>gpg -c file</code><br />
<code>gpg file.gpg</code></p>
<p><strong>Wget &#8211; Download Files from Web</strong></p>
<p>* <em>Options</em><br />
-r: downloads the whole directory<br />
-c: continues the previous download<br />
-b: goes to background execution<br />
-p: path to place the downloaded files</p>
<p>* <em>Usage</em><br />
The following command, downloads the whole directory, going to background after starting the download.<br />
<code>wget -r -b http://www.somedomain.com/files/</code></p>
<p><strong>Slocate &#8211; Search &amp; Locate files</strong><br />
This command builds the slocate database. It will take several minutes to complete this command.This command must be used before searching for files, however cron runs this command periodically on most systems.locate whereis Lists all files whose names contain the string &#8220;whereis&#8221;. directory.</p>
<p><strong>Cat &#8211; Contents of Files</strong><br />
Sends file contents to standard output. This is a way to list the contents of short files to the screen.</p>
<p><strong>Whereis</strong><br />
Report all known instances of a command.</p>
<p><strong>Wc</strong><br />
Print byte, word, and line counts</p>
<p><strong>Bg</strong><br />
Places the current job (or, by using the alternative form, the specified jobs) in the background, suspending its execution so that a new user prompt appears immediately. Use the jobs command to discover the identities of background jobs.</p>
<p><strong>Cal &#8211; month year</strong><br />
Prints a calendar for the specified month of the specified year.</p>
<p><strong>Clear</strong><br />
Clears the terminal screen.</p>
<p><strong>Dmesg</strong><br />
Prints the messages resulting from the most recent system boot.</p>
<p><strong>Fg</strong><br />
Brings the current job (or the specified jobs) to the foreground.</p>
<p><strong>File</strong><br />
Determines and prints a description of the type of each specified file.</p>
<p><strong>Free</strong><br />
Displays the amount of used and free system memory.</p>
<p><strong>Ftp</strong><br />
Opens an FTP connection to the specified host, allowing files to be transferred. The FTP program provides subcommands for accomplishing file transfers.</p>
<p>* <em>Usage</em><br />
<code>ftp hostname</code></p>
<p><strong>Head</strong><br />
Prints the first several lines of each specified file.</p>
<p><strong>Kill</strong> process_ids<br />
Kills the specified processes, sends the specified processes the specified signal (given as a number or name), or prints a list of available signals.</p>
<p>* <em>Usage</em><br />
<code>kill - signal process_ids<br />
kill -l<br />
killall program<br />
killall - signal program<br />
</code></p>
<p><strong>Mail</strong><br />
Launches a simple mail client that permits sending and receiving email messages.</p>
<p><strong>Ping host</strong><br />
Sends an echo request via TCP/IP to the specified host. A response confirms that the host is operational.</p>
<p><strong>Reboot</strong><br />
Reboots the system.</p>
<p><strong>Shutdown</strong><br />
Shuts down the system after the specified number of minutes elapses (requires root privileges). The -r option causes the system to be rebooted once it has shut down.</p>
<p><code>shutdown -r minutes</code></p>
<p><strong>Telnet</strong><br />
Opens a login session on the specified host.</p>
<p><code>telnet host</code></p>
<p><strong>Top &#8211; System Resources</strong><br />
Prints a display of system processes that&#8217;s continually updated until the user presses the q key.</p>
<p><strong>Traceroute</strong><br />
Uses echo requests to determine and print a network path to the host.</p>
<p><code>traceroute 1.1.1.1</code></p>
<p><strong>Uptime</strong><br />
Prints the system uptime.</p>
<p><strong>W</strong><br />
Prints the current system users.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fwww.wowebmaster.com%2Flinux%2Fbasic-bash-commands-in-linux%2F&amp;linkname=Basic%20Bash%20Commands%20in%20Linux"><img src="http://www.wowebmaster.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.wowebmaster.com/linux/basic-bash-commands-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
