<?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>TuxArena &#187; tutorial</title>
	<atom:link href="http://www.tuxarena.com/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tuxarena.com</link>
	<description>Ubuntu/Debian/Mint news and tutorials &#124; Linux stuff</description>
	<lastBuildDate>Sat, 11 May 2013 13:35:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>20 Popular Command-Line Tips for Linux</title>
		<link>http://www.tuxarena.com/2010/12/20-popular-command-line-tips/</link>
		<comments>http://www.tuxarena.com/2010/12/20-popular-command-line-tips/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 09:50:06 +0000</pubDate>
		<dc:creator>Craciun Dan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.tuxarena.com/?p=388</guid>
		<description><![CDATA[Take a screenshot in command-line Taking a screenshot in command-line is very easy using the import tool, which is included in the ImageMagick suite. To take a screenshot of a single window use: import filename.png To take a screenshot of a single window and include window decorations, use: import -border filename.png To take a screenshot [...]]]></description>
				<content:encoded><![CDATA[<div class="subtitle"><strong>Take a screenshot in command-line</strong></div>
<p>Taking a screenshot in command-line is very easy using the <strong>import</strong> tool, which is included in the ImageMagick suite. To take a screenshot of a single window use:</p>
<pre><textarea cols="72" rows="1">import filename.png
</textarea></pre>
<p>To take a screenshot of a single window and include window decorations, use:</p>
<pre><textarea cols="72" rows="1">import -border filename.png
</textarea></pre>
<p><span id="more-388"></span><br />
To take a screenshot of the entire screen or a region, type:</p>
<pre><textarea cols="72" rows="1">import filename.png
</textarea></pre>
<p>And then select with the mouse the region which you want to save.<br />
<br class="blank" /></p>
<div class="subtitle"><strong>Mount an ISO image</strong></div>
<p>To mount an ISO image, we&#8217;ll first create a mount point (an empty directory) and then we will use the <strong>mount</strong> command:</p>
<pre><textarea cols="72" rows="1">sudo mkdir /mnt/iso_image/
sudo mount -o loop iso_image.iso /mnt/iso_image/
</textarea></pre>
<p><br class="blank" /></p>
<div class="subtitle"><strong>Kill processes with &#8216;pidof&#8217;</strong></div>
<p><strong>pidof</strong> is a command which will return the PID of the process specified as argument. To kill an application we would use:</p>
<pre><textarea cols="72" rows="1">kill -9 $(pidof process_name)
</textarea></pre>
<p>For example:</p>
<pre><textarea cols="72" rows="2">kill -9 $(pidof amarokapp)
kill -9 $(pidof firefox-bin)
</textarea></pre>
<p>The first one kills Amarok, while the second one kills Firefox.<br />
<br class="blank" /></p>
<div class="subtitle"><strong>Convert NRG images to ISO</strong></div>
<p>For this one we will use a tool called <strong>nrg2iso</strong>:</p>
<pre><textarea cols="72" rows="1">nrg2iso input_image.nrg output_image.iso
</textarea></pre>
<p><br class="blank" /></p>
<div class="subtitle"><strong>Count lines, words and characters in a text file</strong></div>
<p><strong>wc</strong> is a command-line tool which returns the number of lines, words or characters in a file, depending on which parameter we specify at the command-line. To count the number of lines:</p>
<pre><textarea cols="72" rows="1">wc -l input_file.txt
</textarea></pre>
<p>To count the number of words:</p>
<pre><textarea cols="72" rows="1">wc -w input_file.txt
</textarea></pre>
<p>And to count the total number of characters:</p>
<pre><textarea cols="72" rows="1">wc -c input_file.txt
</textarea></pre>
<p><br class="blank" /></p>
<div class="subtitle"><strong>Resize images from command-line</strong></div>
<p>For this one we&#8217;ll need <strong>conver</strong>, a tool which comes included with ImageMagick. <strong>convert</strong> allows to convert between various image formats, and apply tons of effects to images. Here&#8217;s an example on resizing an image:</p>
<pre><textarea cols="72" rows="1">convert -sample 30%x30% input_image.png output_image.png
</textarea></pre>
<p>Which will resize an image to 30% keeping its aspect ratio.<br />
<br class="blank" /></p>
<div class="subtitle"><strong>Convert MKV to AVI with mencoder</strong></div>
<p>This is a way of converting Matroska Video files to AVI with mencoder:</p>
<pre><textarea cols="72" rows="1">mencoder input_file.mkv -ffourcc xvid -ovc lavc -lavcopts vcodec=xvid:vhq:vbitrate=1800 -oac mp3lame -lameopts vbr=5 -o output_file.avi
</textarea></pre>
<p><br class="blank" /></p>
<div class="subtitle"><strong>Create ISO images from command-line with genisoimage</strong></div>
<p>We will use <strong>genisoimage</strong> for this one. Here&#8217;s how to create an ISO 9660 image from a directory, keeping that directory as root:</p>
<pre><textarea cols="72" rows="1">genisoimage -o output_file.iso directory_name
</textarea></pre>
<p>And to create an image from several files, without including a root directory:</p>
<pre><textarea cols="72" rows="2">genisoimage -o output_file.iso file1 file2 file3
</textarea></pre>
<p><br class="blank" /></p>
<div class="subtitle"><strong>Close a port</strong></div>
<p>First, to see what ports are opened on your system use <strong>nmap</strong>:</p>
<pre><textarea cols="72" rows="1">nmap localhost
</textarea></pre>
<p>This will output a list of open ports and the protocol currently using them. To close any of them, use the following syntax as root:</p>
<pre><textarea cols="72" rows="1">fuser -k 80/tcp
</textarea></pre>
<p>Which will close port 80, the default port used by the web server.<br />
<br class="blank" /></p>
<div class="subtitle"><strong>Split FLAC/WAV/APE with CUE file</strong></div>
<p>For this one we will need the packages <strong>cuetools</strong> and <strong>shntool</strong>, which include the tools needed to split a big FLAC or WAV when a CUE file is available. Here&#8217;s the command:</p>
<pre><textarea cols="72" rows="1">cuebreakpoints cue_file.cue | shnsplit flac_file.flac
</textarea></pre>
<p>The same goes for WAV, just replace the .flac extension.</p>
<p>For APE files, we will first need to convert them to WAV using the <strong>mac</strong> tool, which comes in <strong>monkeys-audio</strong> package:</p>
<pre><textarea cols="72" rows="1">mac input_file.ape output_file.wav -d
</textarea></pre>
<p>And then split the WAV file just like it was showed above.<br />
<br class="blank" /></p>
<div class="subtitle"><strong>Format C code using indent</strong></div>
<p><strong>indent</strong> is a tool which allows to format and change the appearance of C code by inserting/deleting whitespace characters to make the code clearer and easier to read. Some of the coding styles it supports are <strong>GNU indent style</strong> (the default, also invoked with -gnu), <strong>Kernighan &amp; Ritchie style</strong> (invoked with -kr) or <strong>Berkeley style</strong> (invoked with -orig). The example is as follows:</p>
<pre><textarea cols="72" rows="1">indent -kr source_file.c
</textarea></pre>
<p>Which will format source_file.c using the Kernighan &amp; Ritchie style.<br />
<br class="blank" /></p>
<div class="subtitle"><strong>Don&#8217;t exit the shell when pressing Ctrl+D</strong></div>
<p>By default in Bash Ctrl+D will exit the current shell (unless used in a running application to mark end of file). To prevent this you can add the following line in ~/.bashrc:</p>
<pre><textarea cols="72" rows="1">export IGNOREEOF=1
</textarea></pre>
<p>And then source the file to read it again:</p>
<pre><textarea cols="72" rows="1">source ~/.bashrc
</textarea></pre>
<p><br class="blank" /></p>
<div class="subtitle"><strong>Get rid of the system beep</strong></div>
<p>To temporarily disable the PC speaker you can remove its module from the kernel using the following command as root:</p>
<pre><textarea cols="72" rows="1">modprobe -r pcspkr
</textarea></pre>
<p>To permanently disable it, you can blacklist this module so it doesn&#8217;t load when the system starts. To do so, edit the /etc/modprobe.d/blacklist file as root and add the following line in it:</p>
<pre><textarea cols="72" rows="1">blacklist pcspkr
</textarea></pre>
<p><br class="blank" /></p>
<div class="subtitle"><strong>Extract audio only from DVD VOB files</strong></div>
<p>For this we will use mplayer like this:</p>
<pre><textarea cols="72" rows="1">mplayer input_file.vob -aid 128 -dumpaudio -dumpfile output_file.ac3
</textarea></pre>
<p>You can eventually concatenate VOB files first, e.g.:</p>
<pre><textarea cols="72" rows="2">cat VTS_01_1.VOB VTS_01_2.VOB VTS_01_3.VOB &gt; ~/output_file.vob
</textarea></pre>
<p>And then proceed and use the mplayer on the newly create output_file.vob.<br />
<br class="blank" /></p>
<div class="subtitle"><strong>Use lm-sensors to monitor CPU temperature</strong></div>
<p>For this we will need the <strong>lm-sensors</strong> package. After installing it, you will have to load several kernel modules for temperature detection (this is done automatically and you only have to agree or disagree loading the specified module). To run it, just type <strong>sensors</strong> in a terminal:</p>
<pre><textarea cols="72" rows="4">$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +46.0°C  (high = +74.0°C, crit = +100.0°C)
</textarea></pre>
<p><br class="blank" /></p>
<div class="subtitle"><strong>Convert video formats to Ogg Theora using ffmpeg2theora</strong></div>
<p><strong>ffmpeg2theora</strong> is a frontend to ffmpeg which will allow us to convert various video files to the open format Theora video. Here&#8217;s an example:</p>
<pre><textarea cols="72" rows="1">ffmpeg2theora -q 6 -A 192 input_file.avi
</textarea></pre>
<p>This will convert input_file.avi to Theora video using a video quality factor of 6 and an audio bitrate of 192 kbps. Here&#8217;s another example, which will use the default settings:</p>
<pre><textarea cols="72" rows="1">ffmpeg2theora input_file.vob -o output_file.ogg
</textarea></pre>
<p>Or this one, which also adds meta tags to the video:</p>
<pre><textarea cols="72" rows="1">ffmpeg2theora --artist "Pink Floyd" --title "Live at Pompeii" input_file.vob -o output_file.ogg
</textarea></pre>
<p><br class="blank" /></p>
<div class="subtitle"><strong>Convert OGV to FLV</strong></div>
<p>We&#8217;ll use the <strong>ffmpeg</strong> audio and video encoder for this one:</p>
<pre><textarea cols="72" rows="1">ffmpeg -i input_file.ogv output_file.flv
</textarea></pre>
<p>To shrink the size of the resulting video use something like this:</p>
<pre><textarea cols="72" rows="1">ffmpeg -i input_file.ogv -s 640x512 output_file.ogv
</textarea></pre>
<p>To use a specific audio codec for audio output use the <strong>-acodec</strong> switch:</p>
<pre><textarea cols="72" rows="1">ffmpeg -i input_file.ogv -acodec libmp3lame output_file.flv
</textarea></pre>
<p><br class="blank" /></p>
<div class="subtitle"><strong>Create aliases</strong></div>
<p>Aliases are a way of assigning a shorter, custom command to another single or a set of commands (or a one-liner and so on). To create aliases we can edit the ~/.bashrc file and add aliases like this:</p>
<pre><textarea cols="72" rows="3">alias 'killfx='kill -9 $(pidof firefox-bin)'
alias 'back=cd -' # or cd $OLDPWD
alias 'ls=ls -lhXa'
</textarea></pre>
<p>The first one will define a new custom alias, called <strong>killfx</strong>, which will kill Firefox when used. The second one will go back to the previous working directory, while the third one will make the ls to be aliased to <strong>ls -lhXa</strong>, which shows hidden files, detailed information, human readable sizes and sorts the files according to their type.<br />
<br class="blank" /></p>
<div class="subtitle"><strong>Convert BIN/NRG/MDF images to ISO</strong></div>
<p>For this one we will use the <strong>iat</strong> utility:</p>
<pre><textarea cols="72" rows="1">iat input_file.nrg output_file.iso
</textarea></pre>
<p><strong>iat</strong> can supports many image formats, including ISO, NRG, BIN and MDF.<br />
<br class="blank" /></p>
<div class="subtitle"><strong>Rip FLAC/WAV to Ogg Vorbis or MP3</strong></div>
<p>For converting FLAC or WAV to Vorbis or MP3 we&#8217;ll need the <strong>vorbis-tools</strong> and <strong>lame</strong> packages. To convert from FLAC/WAV to Ogg Vorbis:</p>
<pre><textarea cols="72" rows="1">oggenc -b 256 input_file.flac -o output_file.ogg
</textarea></pre>
<p>Which will convert input_file.flac to Ogg Vorbis using a bitrate of 256 kbps. To convert FLAC to MP3 you will first need to convert it to WAV using <strong>flac -d input_file.flac</strong> and then convert the obtained WAV to MP3 using:</p>
<pre><textarea cols="72" rows="1">lame -b 192 input_file.wav
</textarea></pre>
<p>Which will use a bitrate of 192 kbps.<br />
<br class="blank" /></p>
<p>Have some more one-liners or tips? Please share them with us in the comments below!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuxarena.com/2010/12/20-popular-command-line-tips/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Second Free PDF Guide Is Here!</title>
		<link>http://www.tuxarena.com/2010/12/second-free-pdf-guide-is-here/</link>
		<comments>http://www.tuxarena.com/2010/12/second-free-pdf-guide-is-here/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 15:28:03 +0000</pubDate>
		<dc:creator>Craciun Dan</dc:creator>
				<category><![CDATA[Ebooks]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[music players]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.tuxarena.com/?p=375</guid>
		<description><![CDATA[TuxArena is proud to announce the second free PDF giveaway: Command-Line Guide to Audio Files in Ubuntu. You can read it online here or download the PDF from here. The guide explains the basics of manipulating audio files in command-line mode, as well as converting to and from various audio formats, with an accent on [...]]]></description>
				<content:encoded><![CDATA[<p>TuxArena is proud to announce the second free PDF giveaway: <strong>Command-Line Guide to Audio Files in Ubuntu</strong>. You can read it online <a href="http://www.tuxarena.com/static/cli_audio_guide.php">here</a> or download the PDF from <a href="http://www.tuxarena.com/static/tuxarena_cli_audio_guide.pdf">here</a>.</p>
<p>The guide explains the basics of manipulating audio files in command-line mode, as well as converting to and from various audio formats, with an accent on the free formats FLAC and Ogg Vorbis. Here are the topics covered:</p>
<p><span id="more-375"></span><br />
Introduction to Audio Manipulation on Linux<br />
The Setup: Tools That We Need<br />
Converting FLAC to WAV and Vice-Versa<br />
Converting FLAC or WAV to Ogg Vorbis<br />
Editing Ogg Vorbis Tags<br />
Converting FLAC or WAV to MP3<br />
Ripping Audio CDs<br />
Split FLAC, WAV or APE With a CUE File<br />
Converting WMA to Ogg Vorbis<br />
Converting APE to Ogg Vorbis or MP3<br />
Converting AC3 to WAV Using MPlayer<br />
Music Players</p>
<p>Please feel free to use the comments below for suggestions or corrections and help me improve this guide.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuxarena.com/2010/12/second-free-pdf-guide-is-here/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>TuxArena Free PDF Guide! Introduction to Linux Command-Line for Beginners</title>
		<link>http://www.tuxarena.com/2010/12/tuxarena-free-pdf-guide-introduction-to-linux-command-line-for-beginners/</link>
		<comments>http://www.tuxarena.com/2010/12/tuxarena-free-pdf-guide-introduction-to-linux-command-line-for-beginners/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 18:42:03 +0000</pubDate>
		<dc:creator>Craciun Dan</dc:creator>
				<category><![CDATA[Ebooks]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.tuxarena.com/?p=338</guid>
		<description><![CDATA[The first TuxArena PDF ebook &#8220;Introduction to Linux Command-Line for Beginners&#8221; is now available completely free as a Christmas gift! You can read it online here or download the PDF version. The guide covers the following topics: What Is Linux? Basic Commands and Concepts Moving Around More Useful CLI Commands The Power of the Shell [...]]]></description>
				<content:encoded><![CDATA[<p>The first TuxArena PDF ebook &#8220;<strong>Introduction to Linux Command-Line for Beginners</strong>&#8221; is now available <strong>completely free</strong> as a Christmas gift! You can <a href="http://www.tuxarena.com/static/intro_linux_cli.php">read it online here</a> or <a href="http://www.tuxarena.com/static/tuxarena_intro_linux_cli.pdf">download the PDF version</a>.</p>
<p>The guide covers the following topics:</p>
<p><span id="more-338"></span></p>
<p>What Is Linux?<br />
Basic Commands and Concepts<br />
Moving Around<br />
More Useful CLI Commands<br />
The Power of the Shell<br />
Creating and Editing Files<br />
Linux Directory Structure<br />
Environment Variables<br />
Bash built-ins<br />
Pipes and Redirecting Output<br />
Getting Help<br />
Helpful Links &amp; Further Reading</p>
<p>This is the first release so more improvements and corrections will be added, as well as new chapters.</p>
<p>If you have suggestions or corrections to this guide, please feel free to use the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuxarena.com/2010/12/tuxarena-free-pdf-guide-introduction-to-linux-command-line-for-beginners/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
