LinuxIndya | Home | Blog

Mastering Linux

Table of Contents

So moving all the blogs from linuxindya.com to this page and also I will make blog really big with lot of content so you can also follow in an easy way.

1 Change display resolution in Linux

Your Graphics Card support higher resolutions but your Linux distribution display is set to 800x600. You can change the resolution easily by following the below steps.

  1. First check all the possible resolutions supported by your graphics card using the following command.

It will display all possible resolutions like this. The current selected resolution will have a * (asterix) next to it.

  1. Change resolution.

Suppose your graphics card support 1024x768 resolution then you can change it using the following command.

xrandr -s 1024x768

2 Organize your notes using KNotes

Knotes is an useful small application for managing your notes. It comes as a part of KDE PIM Package.


This is how Notes appear on the Desktop. It has a decent interface. Notes are saved by the date and time they were created, Of Course it can be changed. The Pin on the top left gives Notes a nice visual appeal.


By default the background color of notes is yellow and text color is black. It can be changed in the settings. Settings section also has the option to change the default Width and Height of the notes. Though notes can be resized manually using mouse.


One very nice feature of KNotes is sending the Notes to anyone through mail. Default mail client for sending Notes is kmail but it can be changed to any other mail client like Evolution in Action settings.


Notes can be sent or received over a network. Changes can be done in the Network settings.

Good Points

Alarm: You can set alarms Mail: Mail your notes Send Notes over netork Good GUI: background color of the notes can be changed Bad Points

Not Optimized for both Mouse and Keyboard: There should have been more keyboard shortcuts for managing the notes Conclusion You cannot take your computer with you but with the help of KNotes you can organize of Desktop more effectively and it is a really nice application to remind you of important tasks.

3 Find your computer's IP Address

Enter the following command in Linux terminal to find your computer's IP Address.


4 Serial Mouse in Linux - Get it working

If your serial mouse is not working in Linux then do the following steps.

  1. Go to Terminal.
  2. Login as root.
  3. Open /etc/X11/xorg.conf file in your favorite editor.
  4. Under the mouse section change the following.

"Device" "/dev/ttyS0" "Protocol" "Microsoft"

  1. Restart your computer.

5 How to configure MySQL?

By default the root password for MySQL is blank, but it is not safe.

Set the root password by entering the following in terminal.

mysqladmin -u root -p password 'password'

This will set the root password.

Now you can login to the MySQL using the password you have just created.

mysql -u root -p

This will ask you for the root password, just enter the password to access the MySQL console.

6 Reset forgotten MySQL root password

If you have forgotten your MySQL root password then don't worry. You can reset your lost password. Here is the procedure.

  1. Login as root.
  2. Kill running MySQL process and stop the MySQL service.

[root@localhost root]# killall mysqld [root@localhost root]# /usr/libexec/mysqld -Sg –user=root &

  1. Restart MySQL server with these parameters

[root@localhost root]# mysqld –skip-grant-tables –user=root

  1. Manually set root password in the table "user" of "mysql" database.

[root@localhost root]# mysql

Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 1 to server version: 3.23.41 Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql> USE mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed

mysql> UPDATE user -> SET password=password("newpassword") -> WHERE user="root";

Query OK, 2 rows affected (0.04 sec) Rows matched: 2 Changed: 2 Warnings: 0

mysql> flush privileges; Query OK, 0 rows affected (0.01 sec)

mysql> exit;

[root@localhosthost root]# killall mysqld

  1. Restart MySQL again

[root@localhosthost root]# /etc/init.d/mysqld start

Now your root password is set and you can now login as root using the password you have just created.

[root@localhost root]# mysql -u root -p Enter Password: "newpassword"

If you again forget your root password don't worry just check this link again :)

7 uptime - Tell how long the system has been running

uptime gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.


8 5.1 Sound on Fedora 7

I am using Linux for so many years now but I also keep windows installed on my PC. I need windows just for one damn single thing, 5.1 sound! I was never able to enable 5.1 on fedora. I have been searching on internet, sending mails to mail groups and asking every other Linux geek but none helped. I guess today is my lucky day :)

I came across this page on the internet ALSA Multi-channel Audio mini-HOWTO by Uday Bondhugula. I followed the instruction given by him on this page. After following each and every step carefully I was able to get all my 5 speakers and Sub-woofer working!! But when I ran speaker-test -c 6 -D surround51 command I realized that my center and LFE speakers are actually swapped :( then I quickly mailed Uday asking for help and not hoping for his reply. To my surprise he replied soon (God bless you Uday) and asked me to run cat /proc/asound/card0/id command. He then asked me to make the changes in my /etc/alsa/cards/ATIIXP.conf file. Actually earlier I was struggling with /etc/alsa/cards/ICH4.conf file.

Now everything is great. I can hear sound from all my speakers on fedora 7. I am using MSI RS480-IL motherboard. Which has an on-board sound card.

If you find any difficulty enabling 5.1 on your Linux then let me know. May be I can help you :p

Happy Dolby!!

9 uname - print system information

If you want the know your system information like the Kernel name, Kernel Release, Kernel Version etc then you can issue uname command.

Here is the details of the command along with the arguments. This information is fetched from manual pages.

uname -a

10 fdisk in fedora 8

I installed Fedora 8 last week on my computer. After installation I wanted to mount one windows FAT32 partition, before mounting the partition I fired fdisk command to check the partition letters. To my surprise fdisk command was not there!

But there was nothing to worry about. I found this tool icommand sbin folder

So if you are using fedora 8 and want to use fdisk then use….

11 Current working directory in BASH

For all those newbies in the world of Linux here is a very useful linux command.

[root@localhost practice]# pwd /home/ravi/windows/d/myfiles/tutorials/c++/practice pwd will print the current working directory in the konsole.

12 BASH - Display date/time, hostname and current directory

To display date/time, hostname and current directory use the following command in your BASH prompt and press enter. PS1="[\d \t \u@\h:\w ] $ " After pressing enter your BASH prompt will look like this. [Mon Apr 28 14:04:48 ravisa@incgnddw0062:/cygdrive/e/myfiles/] $ I used this command on Cygwin running on Window XP. The hostname and current directory will be different in your case.

13 Re-Mount /etc/fstab without Restarting

You have added new entry in your /etc/fstab file to mount a drive or partition. To mount those new partitions you would normally reboot your PC. There is a simple way which will Re-Mount the drives in your /etc/fstab file. Run as root. mount -a

14 IP Tables - Secure your Linux computer

Secure your computer using IP Tables. Click on the link below. It has a nice tutorial on IP Tables.


15 KDE - Do not show windows from all the Desktops

By default the Windows from all the Desktops are displayed in all the KDE Desktops. You can disable this feature by following the below mentioned step.

  1. Go to Control Center > Desktop > Taskbar
  2. Under Taskbar section uncheck the checkbox "Show windows from all desktops"

16 Project Management Open Source Softwares

Yesterday I was searching for Open Source Project Management softwares and found OpenProj.

To my surprise it is very much like Microsoft Project. I don't know how good it is, I will try it. In the mean time I have to try other Open Source PM Tools.

17 HOWTO create an ISO Image?

Today I am testing Sun Virtual Box. I want to install windows xp on Fedora but I don't like installing Operating Systems from DVDs or CDs. I thought I should create an ISO Image from the Windows CD. Here is the simple command to create an ISO from the CD ROM.

[ravi@localhost e]$ dd if=/dev/cdrom of=/home/ravi/windows/e/windowss.iso Simple!

18 Useful Keys and How to Get Them to Work in Linux

When you type a command, pressing the Backspace key should remove the last character. Ctrl-U should delete the line from the cursor to the beginning of the line, thus this key combination will delete the whole line if the cursor is at the end of the line.[a] When you have finished entering a command, and it is executing, Ctrl-C should abort it, and Ctrl-Z should suspend it. (When you want to resume the suspended program, enter fg for "foreground.")

[a] Ctrl-U means hold down the Control key and press u.

Ctrl-S stops the terminal output until you turn it on again with Ctrl-Q. This is probably less useful today, as most terminal emulations provide scrolling facilities anyway, but it's important to know if you have hit Ctrl-S by accident and the terminal all of a sudden "becomes unresponsive." Just hit Ctrl-Q to make it respond again; it was just waiting for you.

If any of these keys fail to work, your terminal is not configured correctly for some reason. You can fix it through the stty command. Use the syntax:

stty function key

where function is what you want to do, and key is the key that you press. Specify a control key by putting a circumflex (^) in front of the key.

Here is a set of sample commands to set up the functions described earlier:

$ stty erase ^H $ stty kill ^U $ stty intr ^C $ stty susp ^Z

The first control key shown, ^H, represents the ASCII code generated by the Backspace key.

By the way, you can generate a listing of your current terminal settings by entering stty -a. But that doesn't mean you can understand the output: stty is a complicated command with many uses, some of which require a lot of knowledge about terminals.

19 How to use FTP cmd in Linux !!

Use the ftp (file transfer) command to download files directly to your computer from another computer on the Internet. ftp supports the standard File Transfer Protocol (FTP) and was originally designed to transfer files to and from other networked computers on the Internet.

ftp, found under the /usr/bin directory, has five command-line options and dozens of built-in commands. Use this program from the command line of the console or a terminal window, followed by a name of a remote computer, like this:

Connected to ftp.abc.com. 220 iq-abc FTP server (Version wu-2.4(4) Sun Dec 21 13:01:32 EST 1997) ready. Name (ftp.abc.com:ds):

You can also use an Internet (IP) address to connect to a remote computer, like this:

Connected to 220 iq-abc FTP server (Version wu-2.4(4) Sun Dec 21 13:01:32 EST 1997) ready. Name (

20 How to Add Printer in Linux !!

There are many ways to configure printer in Linux system , in this blog we are sharing most common method through which a printer can be installed . . . . we can add a printer by entering a printer capability definition in the system printer capability database, printcap. This file is found under the /etc directory, and is a text file that can be changed only by the root operator.

The format, commands, and syntax to use when creating a printer entry in the /etc/printcap file are found in the printcap manual page. There are more than 40 different commands, but you can quickly create a printer with only the mx (maximum size of spooled files) and sd (spool directory) commands.

Configuring a simple printer

  1. To create a printer called mylp for the /dev/lp1 device, open the /etc/printcap file with your preferred text editor. The sd option tells the Linux printing daemon, lpd, where to temporarily place printed (spooled) files. The mx command, used with a value of 0, places no limit on the size of spooled files. Type an entry such as this:

mylp:\ :sd=/var/spool/lpd/mylp:\ :mx#0:\ :lp=/dev/lp1:

  1. Save the entry, and then create the printer's spool directory by using the mkdir command:
  2. Make sure the directory lp has the correct group ownership and permissions by using the chgrp and chmod commands, as follows:
  3. Test the printer entry with the lpr (line printer command) using the -P option to specify your newly created printer:
  4. Your printer should activate and print the test document.

21 How to Configuring Sound in Linux

This is one of problem we face after installing Linux successfully . Sound Play major role in exploring different sites . in this blog we are discussing simple configuration of sound . If your system includes a sound adapter supported by Red Hat Linux, you can use sndconfig to configure your adapter. If you're unsure whether your system's sound adapter is supported, check the Red Hat Linux hardware compatibility database at http://hardware.redhat.com. Several popular cards are not fully compatible with Red Hat Linux, so it's best to check the database before wasting time trying to configure incompatible hardware.

To configure your system's adapter, launch a terminal window and issue the following commands:

su - sndconfig

The Sound Configuration utility's Introduction dialog box, appears. The utility has the same user interface as that used by the text-based Red Hat Linux installation program:

  • Use the arrow keys to move from control to control.
  • Use the spacebar to select an item, such as a checkbox.
  • Use Enter to click a button.

Click the OK button and press Enter to continue.

The utility probes your system, seeking supported sound adapters. If the probe fails, the utility announces the failure and lets you select your system's adapter from a list of supported adapters .

After a sound adapter has been identified, the utility may present a dialog box that lets you configure hardware options . To determine the proper settings, refer to your hardware documentation .

Next, the utility plays a sample sound .

If you hear the sound, you can exit the utility. If not, you can go back and select a different sound adapter. If you don't hear the sound, check that your speakers are plugged in and, if necessary, powered on. Otherwise, you may spend time trying to reconfigure a sound adapter that's actually working fine.

If the utility suspects that your sound card includes a MIDI synthesizer, it presents a series of dialog boxes that let you configure the MIDI facility. These dialog boxes resemble those pertaining to audio.

22 How to Configure Mouse in Linux

friend's in this blog we are sharing the way through which u can make full use of your mouse in Linux environment . as we know Mouse is one of most important device of any system and it always help in reducing efforts .

Each button has its function. Left-handed users often find it helpful to switch the functionality of the left and right buttons. All users may want to customize the size of the cursor, as well as the speed of motion. Many users may have problems with the scroll wheel.

The middle mouse button is important for some users. It activates a pop-up menu in the KDE desktop environment, and it pastes recently highlighted text into editors and the command-line interface.

GNOME Mouse Preferences Any user can start the GNOME Mouse Preferences tool with the gnome-mouse-properties command.


Under the Buttons tab, you can configure a "left-handed" mouse, which switches the left and right buttons on a standard mouse. This is often preferred by left-handed users. The double-click timeout specifies the amount of time that can pass between clicks when double-clicking on an item. Users who have problems with double-click speed may want to experiment with this setting.


Under the Cursors tab, you can specify the size of the cursor. The default size may be too small, especially for nearsighted users who have configured a high dot-pitch resolution (such as 1600 × 1200).


Under the Motion tab, you can specify the speed (Acceleration) with which you can move the pointer, the Sensitivity of your pointer to motion, and the Threshold associated with drag-and-drop actions.

If you're running Debian or SUSE Linux, changes are saved to the individual user's home directory, in the ~/.gconf/%gconf-tree.xml configuration file. If you're running Red Hat/Fedora Linux, changes are saved to the %gconf.xml file in the ~/.gconf/desktop/gnome/peripherals/mouse directory (which you won't see if you use default settings).

KDE Mouse Preferences

Any user can start the KDE Configure Mouse tool with the kcmshell mouse command.


Under the General tab, you can configure a "left-handed" mouse, which switches the left and right buttons on a standard mouse. You can even reverse the effect of a scroll wheel. You can also modify the behavior of single- and double-clicks with respect to opening files and folders.

Cursor Theme

You can select the cursor theme of your choice. Some themes may be easier to see in your GUI than others.

Advanced and Mouse Navigation (two tabs)

You can customize the way the mouse moves on your screen, as well as the drag-and-drop behavior of the mouse, using the options available under both of these tabs. Users with problems working with their pointing devices may want to experiment with some of these settings.

23 How to take Screenshot in Linux

A picture is worth a thousand words , when you need to document anything . in microsoft window its the one of simple thing we can do . there are many ways and utilities through which a screen shot can be taken in Linux . In this Blog we are sharing simple way to take Screenshot .

From the Command Line

One of the simplest and most universal ways to take a screenshot is with the import command from the ImageMagick suite of utilities. This is a very common tool, and chances are that ImageMagick is already installed by your distribution; if not, packages should be readily available. import has two major screenshot modes. To take a picture of the entire screen, type:

$ import -window root screenshot.png

The -window root argument tells import to take a picture of the entire screen. If you type:

$ import screenshot.png

Your cursor turns into crosshairs, allowing you to drag across the section of screen you want to copy. Once you release the mouse button, the part of the screen that is selected becomes the part import will put into your image. import supports all common image formats used for screenshots, including JPEG, PNG, and BMP (useful for lossless screenshots). All you have to do is name your output file with the file extension you want—import will figure out the rest.

If you want to set a time delay so you can arrange your windows or possibly hide the terminal containing the import command, just preface your import command with sleep. To allow five seconds before a screenshot is taken, type:

$ sleep 5; import -window root screenshot.png

From Within GNOME

GNOME uses its own screenshot program called gnome-panel-screenshot. This program can be accessed a number of ways, but probably the easiest is to press the Print Screen key on your keyboard. This immediately takes a screenshot of the entire screen and displays a dialog you can use to name and save the screenshot file. To take a picture of the current window, just press Alt–Print Screen instead. This program is also accessible in the panel menu. Click Actions → Take Screenshot. You can even access this program directly from the command line with:

$ gnome-panel-screenshot –delay 5

This command causes GNOME to pause five seconds before taking a screenshot. GNOME then presents you with a dialog so you can choose the filename to save to.

From Within KDE

If you use the KDE desktop, ksnapshot is the KDE alternative to gnome-panel-screenshot and can usually be found within the K Menu → Graphics menu. The GUI allows you to choose a delay, take a screenshot, and choose whether to take the screenshot of the entire desktop or just the current window. You can, of course, also start ksnapshot just by typing ksnapshot in a terminal window or in the Run Command window, which you can access by pressing Alt-F2.

24 Watch TV on Your Linux Computer

Every TV hardware that is Tv Tuner is installed in your computer but still your are not able to watch TV on it . so what Next ? This Blog covers some of the Linux tools you can use to configure your TV tuner and watch TV with it from your Linux desktop.

i) xawtv The most basic program you can use to watch TV under Linux is xawtv . With xawtv installed, you could just immediately launch it; however, no channel frequencies for your particular tuner have been configured yet, so you won't be able to tune into a channel. It's possible to configure everything by hand, but xawtv includes a utility called scantv that scans the tuner for available channels (much like the scan function on many car stereos) and generates a configuration file for xawtv. Open up a terminal and type:

$ scantv -o ~/.xawtv

please select your TV norm 0: PAL 1: NTSC 2: SECAM 3: PAL-Nc 4: PAL-M 5: PAL-N 6: NTSC-JP 7: PAL-60 nr ? 1

please select a frequency table 0: us-bcast 1: us-cable 2: us-cable-hrc 3: japan-bcast 4: japan-cable 5: europe-west 6: europe-east 7: italy 8: newzealand 9: australia 10: ireland 11: france 12: china-bcast 13: southafrica 14: argentina 15: australia-optus 16: russia nr ? 1

scanning channel list us-cable… 1 ( 73.25 MHz): no station …

  1. Zapping

xawtv works fine, but it doesn't have much of a GUI. Zapping is a TV viewing program designed for the GNOME environment, but it will work on either GNOME or KDE. Zapping is already packaged for a number of distributions, so check with your package installation tool first, and if it isn't there, download and compile Zapping from the source package at http://zapping.sourceforge.net/cgi-bin/view/Main/Download.

To start Zapping, launch it from your desktop menu or type zapping in a terminal window. Zapping will automatically scan for valid video4linux devices and connect to the first one found. You must initially configure which video standard to use, so click Channels → Video standards and choose your standard from the list (I'm in the United States, so I would choose NTSC). If you have more than one video4linux device in your computer, click Edit → Preferences to open the preferences window, and then click Devices → Video. You can change the video device to use from this window, and click Devices → Audio to change your audio device. One nice feature of Zapping is that it supports OSS as well as ESD and aRts audio output. The preferences window also lets you configure a lot of other general options such as keyboard shortcuts and on-screen display settings.

Next you need to configure the channels for your tuner device. Click Edit → Channels to bring up the channel configuration window. Choose your region from the region drop-down menu, and then click "Automatic station search" to let Zapping search for channels for you. Alternatively you can have Zapping load the channel information from a xawtv configuration file. In this window, you can also assign names for each of the channels and a key binding so you can quickly switch to a certain channel.

You can change channels in the main interface either with the buttons on the toolbar, or by pressing PgUp and PgDown. The + and - keys control the volume. You can even take a quick screenshot with the s key.

25 How to Recover Root Password

As Linux geeks, we have a responsibility to set a good example and avoid easy passwords. However, if you have to change your password frequently, there's a chance that you'll forget it.

Single-User Mode

  1. Boot your computer into single-user mode, which logs you in as the root user, without network connections or server services.
  2. Linux mounts only the root filesystem (the / directory) in single-user mode, but you can mount other filesystems manually with the mount command if you need them.
  3. Use the passwd command to reset the root password.

To boot your computer in single-user mode, you need to access the kernel command line from your Linux bootloader.

26 Basic Shell Programming

The most popular Linux shell is bash. This stands for Bourne Again Shell, and is named after one of the original UNIX shell designers. bash has a lighter relative, ash, which lacks some features such as command-line histories, but requires substantially less memory and is therefore found in some Linux distributions and on emergency recovery disks. Clones of the standard UNIX shells, sh (the Bourne shell), csh (the c shell), and ksh (the Korn shell) are also available.

Another point to remember is that a shell under Linux (as well as under other UNIX systems, and interestingly enough, under DOS and OS/2) is just another program. You can start another shell from the shell you're in, just like you can start the program ls to get a directory listing. This is significant because many shell scripts are not interpreted by the same type of shell in which you type the command; instead, a different shell is started to process the command. The different shells have different syntaxes. If a program is written using sh but you are running bash, it makes sense that sh would be started when your shell script is started.

What Shell Scripts Are Used For Shell scripts are actually one of the most common types of programs on all UNIX systems. They are relatively easy to write and maintain, and they can tie together other programs (for example, other shell scripts) to get a lot of work done with one simple command.

Every time you log in to your Linux system, the system executes a shell script before you even see the first $ prompt. Almost all aspects of system startup, including network initialization, are controlled by shell scripts. For a regular Linux system user, shell scripts can make work easier and more productive. For the Linux system administrator, a basic understanding of shell scripts makes all the difference between a well-run and trouble-free Linux system and one that can get really ugly, really fast.

Writing Shell Programs Shell programs are similar to batch files in the DOS world. Unlike DOS batch files, however, shell programs have much more advanced functionality; they are akin to conventional programming languages. Entire books have been written about most available shells; this chapter covers only bash because it is the most popular, and because it is used by default on Red Hat, Caldera, and most popular Linux distributions.

A Sample Program The last thing the world needs is another "Hello, World!" program. Instead, I want to show you something useful. For example, suppose you want a nicely formatted printout of what is in the current directory. The code shown below provides a means to do just that (the numbers at the beginning of each line are for your use; they do not actually appear in the code).

01 #!/bin/bash 02 #Sample Program for Practical Linux 03 # www.linuxindya.com 04 # Blog Basic Shell 05 # written by v dev 06 # and checked by ravi 07 # This code comes without warranty of any kind. If it breaks u get 08 # to keep both pieces. 09 ls -l > /tmp/lstemp 10 pr /tmp/lstemp | lpr 11 rm /tmp/lstmp 12 #end of script

This script works best when you're logged in as a regular user rather than system administrator; it assumes that you have a printer installed and correctly configured. Simply put, it executes the commands in the file in sequence. The more interesting aspects of this listing are as follows:

  • Line 1 tells the system which shell the system should start to execute the script. This is vital because different shell programs sport different built-in commands.
  • Line 9 executes the program ls -l and redirects output to a file in the system temporary directory.
  • Line 10 feeds the contents to pr (which breaks the file into pages and, depending on the arguments, numbers the pages, adds a nice header, and so on) and feeds the output of pr to lpr, the system print spooler. The important point here is the redirection of the output of commands, not the commands themselves.
  • Line 11 removes the temporary file created in line 3.

27 How to Automate your Life in Linux using Cron

One of the great benefits of using computers is that they are ideal candidates for performing the uninteresting jobs humans get tired of doing. Most of us would be bored senseless making database backups everyday, cleaning out disks, updating report files, and managing system logs. These activities are typically linear, mundane processes that are straightforward enough to require little intervention, which makes them ideal candidates for automation.

One of the most fundamental pieces of the toolbox within all Unix-type operating systems is called cron. This small utility is like an alarm clock. When the alarm goes off, it tells the computer to do whatever you have configured it to do. As an example, if you perform a backup every day, you can get cron to perform this for you at a specific time. Another example is if you need to generate a weekly report about a project—cron can generate this report automatically.

An important point to note is that cron does not actually perform these activities itself. cron's only function is to trigger a specific process or series of commands at a certain time. When the specified time occurs, the commands and tools that are needed to complete the activity are run. As such, to automate a process on your computer, you need to determine how you can complete your task with a series of command-line tools. This usually means you need to create a script with the commands for cron to run at specified intervals.

Create a Cronjob

The cron program reads in a special file called a crontab. This file specifies jobs to be run and their times. You can access this file by running:

foo@bar:~$ crontab -e

This command uses the system's default command-line editor so that you can edit the crontab. If you want to set this editor to a different one (such as jed), set the $EDITOR environment variable prior to editing crontab:

foo@bar:~$ export EDITOR=jed

If this is your first use of cron, it is likely that your crontab is empty; unless some special system cronjobs were added (these automatically added crontabs are quite common in a number of Linux tools and utilities). Each cronjob consists of a single line containing the time of the cronjob, as well as the command to run.

A simple example of a crontab entry is:

30 3 1 * * /home/foo/createreport.sh

This example runs a script called createreport.sh at 3:30 a.m. on the first day of each month. The numbers on the left side of the line identify the time at which the script should be run, and the /home/foo/createreport.sh part shows the location and name of the script. It is always important that you use full and absolute paths when referring to scripts and files, as cron does not understand relative paths.

The numbers and stars on the left side of the line are entries in five different columns. Here are the columns, from left to right.


This column indicates the minute part of the time in which the cronjob is to be run.


This column indicates the hour of the job and is given in 23-hour time (023). The time between midnight and 1:00 a.m. is the 0 hour.


This is the number of the day in the month when the job is to be run.


This is the month number between 1 and 12.

Day of the week

This is the day of the week, between 0 and 6, where 0 is Sunday.

In this example, you indicated the time as 3:30 a.m., and the day as the first day of the month. The two asterisks (*) show you want to run the script for each time increment in that column—i.e., every day or month. As per the example, the * in the month and day-of-the-week columns means the cronjob will run every month and every day.

When you have finished editing the crontab, saved the file, and exited, the changes are automatically enabled. You can view the entries in the crontab file by running:

foo@bar:~$ crontab -l

You can also remove the entire crontab by using the -r option:

foo@bar:~$ crontab -r

28 How to Access Entire Desktop Remotely in Linux

There is no doubt that running X applications remotely is useful, but a truly killer feature is the ability to run the entire desktop from a remote computer on your local machine. To do this, you need to use a feature called the X Display Manager Control Protocol (XDMCP), which is part of X. This protocol allows remote computers to access the GDM/KDM/XDM login program, which then gives access to the remote desktop. If you have a reasonably fast network connection—Ethernet speeds of 10-Mbit or greater are recommended—it is possible for a slow computer to be as responsive as a cutting-edge machine.This is possible because the local box is just a display device, like a television, and all the real work is done on the faster remote machine.

To use XDMCP, you must be running XDM, GDM, or KDM as your login manager on the remote machine. Each display manager has support for XDMCP, and you must turn on that support.

To enable XDMCP in GDM, you need to load the gdmconfig tool. Inside this tool is an XDMCP tab. Turn on XDMCP support by setting the Enable XDMCP option. You can use some additional settings on this tab to fine-tune XDMCP support. After you've made your changes, you must restart GDM.

There is no GUI way to turn on XDMCP in KDM, so you need to edit the kdmrc file on your system. Both a system-wide file (possibly in etc/kde3) and a per-user file (in ~/.kde/share/config) exist. Inside kdmrc is an [Xdmcp] section where you need to set the Enable option to true. After you save this change, you must restart KDM.

When you have turned on this support, you can return to your local machine and search the network for computers that are allowing XDMCP connections. To do this, ensure that you are logged out of X and run the following command:

foo@bar:~$ X -broadcast

X will start and the login screen from the remote machine will appear. Now you can log in and use the machine in the same way as if you were sitting in front of it. If you want to connect to a specific machine on the network, you can also run the following command on your local machine (remember to change the IP address to a host that is relevant to your network):

foo@bar:~$ X -query

29 Undertanding Linux Standard Directories

This Blog explain Linux Standard Directories . All Linux systems provide a standard set of core directories. The following directories are used to hold programs that must run when you are booting your Linux system, configuration files for those programs, libraries used by those programs, temporary files created by running programs, and so on:

  • /: As the top-level directory of a Linux system, this directory must exist so that other directories can be located within it.
  • /bin: A directory that holds core applications used by a Linux system.
  • /dev: A directory that holds special files, known as device nodes, which are used to access any devices that are attached to your Linux system.
  • /etc: A directory that holds system configuration information, contains the files that explain the sequence of applications that execute on a Linux system as part of its boot process, and stores configuration files for some of the applications that are executed by a Linux system.
  • /lib: A directory that holds libraries of functions that can be called by other applications.
  • /proc: A directory in which the Linux kernel tracks active processes and general status information.
  • /sbin: A directory containing applications that are usually executed only by the superuser.
  • /sys: A directory in which the Linux kernel tracks the status of system hardware and related hardware interfaces.
  • /tmp: A directory that holds temporary files created by various applications on a running system.

You will find these standard directories on most Linux systems, regardless of the type of distribution or the size of the disk they are using.

30 How To Take Backup of window system using Linux

Linux works nicely with a number of other computer systems, including Windows. With a few simple commands, Linux will happily safeguard data in those systems as well. entirely. For now, here's a quick Samba example. Pretend that you have a Windows PC called speedy on your network. The user has shared the C: drive with the name SPEEDYC. I can mount that share on a Linux system running Samba like this:

smbmount //speedy/speedyc /mnt/linuxmountpoint

Then, I simply back it up to my drive like this:

cd /mnt/linuxmountpoint tar -cvf /dev/st0.

31 How to Play DVD in Ubuntu

Ubuntu will probably not be able to play most of the DVDs that you own. This isn’t because of an oversight on the part of the Ubuntu developers; it’s simply because most DVDs you might buy are encrypted with a system called CSS (Content Scrambling System). While video-player packages such as totem-gstreamer, totem-xine, xine, mplayer, and vlc can all play unencrypted DVDs, to play CSS-encrypted DVDs, you will have to actually circumvent the encryption scheme. (Note that in certain countries circumventing CSS is not legal, so here is a good place to stop reading and and phone up your attorney before proceeding.)

Ubuntu actually makes this process very simple. The first step is to install one of the aforementioned video-player packages along with the libdvdread3 package, if they aren’t installed, so use your preferred package-installation tool to do so .

After you install libdvdread3, you must run the script it provides to download and install the libdvdcss2 libraries you need. Open a terminal and run the following script:

$ sudo /usr/share/doc/libdvdread3/examples/install-css. sh Password: –20: 19: 23– http: //www. dtek. chalmers. se/groups/dvd/deb/libdvdcss21. 2. 5-1_ i386. deb => ` /tmp/libdvdcss. deb' Resolving www. dtek. chalmers. se. . . 129. 16. 30. 198 Connecting to www. dtek. chalmers. se| 129. 16. 30. 198| : 80. . . connected. HTTP request sent, awaiting response. . . 200 OK Length: 25, 178 (25K) [ text/plain]

100%[ ====================================>] 25, 178 55. 66K/s

20: 19: 25 (55. 54 KB/s) - ` /tmp/libdvdcss. deb' saved [ 25178/25178] (Reading database . . . 59605 files and directories currently installed. ) Preparing to replace libdvdcss2 1. 2. 5-1 (using /tmp/libdvdcss. deb) . . . Unpacking replacement libdvdcss2 . . . Setting up libdvdcss2 (1. 2. 5-1) . . .

That’s all. Now to play a DVD, just insert it into your computer’s DVD player. Ubuntu is configured by default to automatically open DVD video with the Totem media player. If you want to toggle that setting, click System ➝ Preferences ➝ Removable Drives and Media, click the Multimedia tab in the window that appears, and check or uncheck the checkbox next to “Play video DVD disks when inserted” . From the window that appear , you can also change the default program used to open DVDs. Just change the default video player from totem to your program of choice.

To start Totem manually, click Applications ➝ Sound & Video ➝ Movie Player, then click Movie ➝ Play Disc to open your movie. Totem provides a simple interface to navigate through a movie—with standard Play/Pause, previous track, and next track buttons on the main window, along with a sliding bar you can use to quickly skip through a movie. When you are finished watching the movie, click Movie ➝ Eject or hit Ctrl-E from within Totem.

32 Gaming in Linux

Gone are the days when Linux was only used by Geeks. Now a days many people are using Linux as their primary operating system. Another reason is that many Computer Manufacturers now ship their machines with pre-installed Linux Distributions. It reduces the cost to the customers significantly.

Linux can be easily used as the primary system and all kind of day to day softwares like Music Player, Video Player, Word Processing etc can easily be installed on it but some people still complain that installing games is still not possible on linux as most gaming companies either make their games for PS2, Xbox or windows. Linux is usually ignored. What a pitty.

Though this is not true for all the games. Games like Quake can be easily be played on linux. There is a separate package of this game for linux. Apart from that party poker has also become very popular these days. Many of my friends are really hooked to it.

Using Wine linux users can play the windows based games. Though it doesnt work for all the games but if the game is not very graphic intensive then it should surely work with wine and you can enjoy it on your linux system.

Now a days many games can only be played online, which is not really a concern for linux users because they are usually flash based games and works perfectly on linux machine. A Java plugin may also be required for playing such games. so how do you start finding about these games. Well I will leave it up to you. Yes, just go to google.com and typing in online flash games and you will get many sites where you can start playing the games.

In case you can to install the windows based games in linux then you can try to install Wine: www.winehq.org/

Have fun playing!