Tuesday, December 12, 2006

Save time with shell tricks

If u r administering a server without X, or even a normal Linux user, u often open the shell and type commands to do many everyday tasks. So now, i'm going to introduce some tricks for u to use shell better. These may save much time for u and may be make you find out some fun.

(1) Auto complement with Tab key:
If you're typing a long command or a long file name, u should only type some first characters and then press Tab key one or two times. Then, the shell will try to fill it for u.

(2) History:
Use up/down arrow key to get the previous/next command u've just use.

(3) Move:
^ + A or Home to move to the start of the line
^ + E or End to move to the end of the line
^ + left/right arrow key to move back/forward one word

(4) Delete:
^ + K to delete from the cursor to the end of the line
^ + X + Back space to delete from the cursor the the start of the line

(5) Change case:
Esc + U : change the text from the cursor position to the end of the line to Upper case
Esc + L : change the text from the cursor position to the end of the line to Lower case

Finally, u can change your bash shell configuration by editting the following files:
~/.bashrc and ~/.profile for user configure
/etc/bashrc and /etc/profile for global configure

Hope u have fun with these tricks!

Thursday, September 07, 2006

bash: ldconfig: command not found

Somebody ( include me ) meets this error, when run the command
ldconfig

because in this case ldconfig is not in /bin but it's in /sbin
To fix this, you run this
/sbin/ldconfig

How to add a new HDD in Linux

In this tutorial, i'm going to tell you about how to add a new HDD in Linux.
In general, first, you have to format your partition and second mount it to a place.

To format, you use mkfs command.
For example:
mkfs.ext3 /dev/hdb1/

To mount, use mount command ( remember to mkdir first )
For example:
mkdir /mnt/my2ndDisk
mount -t ext3 /dev/hdb1 /mnt/my2ndDisk

In case your HDD is not partitioned, you have to use fdisk command to do this as the following example:
fdisk /dev/hdb

If you have any question about this topic, feel free to comment here !

How to mount FAT32 partition in Linux ( tutorial to mount FAT32 )

If you were an Windows user, the file system format you used are usually FAT32 or NTFS.
You may wonder if you can access FAT32 partition(s) after installing Linux because these FAT32 partition(s) may contain your previous work, ebook, music, libraries.... The answer is "YES, YOU CAN".
So now, in your head is "how ?" and i going to tell you about it right afer.

First, start Logical Volume Manager ( in GNOME, you can find it in System -> Administration -> Logical Volume Manager.
Here, look for your FAT32 partition. As for me, my FAT32 partition is /dev/hda5




Or if you don't use GNOME, use can get a similar result by use the following shell command :
fdisk -l

After getting the information we need, type the 2 easy following shell command to mount that partition to a directory:
mkdir /mnt/fat_partition
mount -t vfat /dev/hda5 /mnt/fat_partition

Now, navigate to the /mnt/fat_partition and see all your data you've create when using Windows :D
If you have any problem, please feel free to comment here, so i'll help with if i can.
Hope this help ;) !

Tuesday, September 05, 2006

How 'Linux' is pronounced ?

In 1992, Torvalds explained how he pronounces the word Linux:
“ 'li' is pronounced with a short [ee] sound: compare prInt, mInImal etc. 'nux' is also short, non-diphthong, like in pUt {IPA /ʊ/}. It's partly due to minix: linux was just my working name for the thing, and as I wrote it to replace minix on my system, the result is what it is... linus' minix became linux. „

—Linus Torvalds, comp.os.linux newsgroup[10]

Introduction to GNU project.

The goal of the GNU project is to produce a Unix-compatible operating system consisting entirely of free software, and most general-purpose Linux distributions rely on GNU libraries and tools written to that effect.

Richard Stallman, founder of the GNU project for a free operating system:

Monday, September 04, 2006

Linux, what's the hell it is ?

You surely have heard about Linux, Unix or something like Fedora Core, RedHat, ... and you may wonder what they are, what's going on with them, what makes it different from Windows ... and much more questions.

In this post, i'm going to tell you about :
+ Operating System in general.
+ Brief history of Linux.
+ An introduction about Linux and its capability.
+ How you can start trying out Linux

NOTE: In the case of you are familiar with one another operating system ( such as Windows, DOS ) you can only skim this post or even ignore this to come to more pragmatic actions !


1. What is Operating System ( OS ) ?

The knowledge of OS make you interact better with it, especially if you wanna develop application on it.
An OS manages and administrates all the system resources and facilities: read/write HDD, CD drive, ..., keep track of what programs are doing, ...
In other words, you can imagine that OS is an interpreter who sits between you and your PC and help you with talking to hardwares.


2. Linux, where are you from ?
UNIX was born in 1960s by Ken Thompson and now becomes very popular in many universities After that, Unix became comercial and rather expensive.But there's a cheap option was Minix, a limited Unix-like system written by Andrew Tanenbaum for teaching purposes.

In 1991, when started out using Minix, Linus Torval wanted a better and started to write his own. After that, Linux recieved plenty of attention and many companies developed and distributed Linux.
A Linux distribution is a Linux Kenel ( The kernel is the part that makes all other programs run. It implements multitasking, and manages hardware devices, and generally enables applications to do their thing.) plus an installation program plus a set of applications to run on top of the kernel. The difference between distributions is the application set.

There are many distributions which are used for many purposes, but the 3 most well know distributions for general purposes are: RedHat, SuSE, Debian.In my case, i start using Linux with Fedora Core 5 ( this distribution is very easy to install and easy to use, you may wanna try it out ).


3. Linux capabilities:
Linux is an Unix-like operating system.
Linux is an multi-tasking ( you can run many tasks at the same time) , multi-user ( more than one user can login at the sametime) operating system. It's also a network enabled OS, which allows you to access from any where.
Linux can do almost everything you need for your work.
A typical general-purpose distribution includes the Linux kernel, some GNU libraries and tools, command-line shells, the graphical X Window System and an accompanying desktop environment such as KDE or GNOME, together with thousands of application software packages, from office suites to compilers, text editors, and scientific tools.
And many other intesting thing waiting for you to discover.

4. Start out Linux:
Now, you may wanna try it out but your old habits prevent you from install Linux.
There're 2 ways for you to try Linux without worrying of destroy your existing system:
a. VMWare Workstation ( download from softpedia.com )
You can use this tool to install Linux in the virtual machine
b. You can use Knoppix, the single bootable CD, for testing Linux without installing.
Link: http://knopper.net/knoppix-mirrors/index-en.html
Not having to install anything on the hard disk means you can easily switch between Linux and Windows. Also, since all Linux files are on a read-only CD-ROM, you can't break anthing by mistake while you're learning.

Here's Linus Torvald! He's handsome, isn't he? :P



Wish all of you have fun with Linux !

Introduction ...

Hello, i'm Vu Phan Anh, from Vietnam.
I start learning Linux ( with the Fedora Core 5 distribution ) from Sep, 2006 in order to work in a project of our lab ( RDLab of Hanoi University of technology, in Hanoi, Vietnam) . In that project, i've to program socket, IPC in Linux enviroment. Before that point of time, i have worked in Windows enviroment for about 8 years and the decision of deleting Windows and installing Fedora Core 5 is such a very difficult decision.

This blog's target is to introduce you from the most basic fundamental concepts about Linux to something much more complex. The following post is formed as "tutorial", which show you the easiest way to get the results you want.

And, what's for now ?
See the next post, please :P !