Monday, January 02, 2012

Make a basic webpage in linux using vi or emacs.

To create a simple webpage:

Use the vi or emacs editor to create and save the UNIXtools.html file, entering the following lines:

(click to enlarge)








Use the chmod command to grant the file execute permission.

In Fedora, Red Hat Enterprise Linux, or SUSE, on your desktop, double-click your home directory's icon, such as trbrown's Home, which opens a Window from which to view the files in your home directory. In Knoppix, click the K Menu and click Home Personal Files.

If necessary, use the scroll bar on the right side of the window to find the UNIXtools.html file.

In Fedora, Red Hat Enterprise Linux, and SUSE, double-click UNIXtools.html (and click Display in Fedora and Red Hat Enterprise Linux) to see your Web page in the Mozilla Firefox Web browser. In Knoppix, right-click UNIXtools.htmk, point to Open With, click Other, click Internet (to list Internet applications, and double-click a Web browser, such as Konqueror.

Close all open windows.

A Simple C Program

The following is a sample program that creates output:

/* A simple C program */
#include
int main()
{
printf("C is a programming language.\n");
printf("C is very compatible with UNIX/Linux.\n");
}

Output:

C is a programming language.
C is very compatible with UNIX/Linux.


In the preceding program, you see the statement:

#include

This is called a preprocessor directive. The preprocessor processes your program before the compiler translate it into object code. It reads your program, looking for statements that begin with the # symbol. These statements are considered preprocessor directives and cause the preprocessor to modify your source code in some way. For example, the #include directive causes the preprocessor to include another file in your program at the point where the #include directive appears.

What is a .bashrc file?




What exactly is a .bashrc file?

.bashrc file -

A file in your home directory that you can use to customize your work environment and specify what occurs each time you log in. Each time you start a shell, that shell executes the commands in .bashrc.