stdin, stdout and stderr:

UNIX has three logical streams or files which are always open and are available to any program.

Stdin                       The standard input-file descriptor 0.

Stdout                    The standard output-file descriptor 1.

Stderr                     The standard error-file descriptor 2.

                The names are a part of the C language and are defined as pointers of type FILE.

                                #include<stdio.h>

                                /*FILE *stdin, *stdout, *stderr; */

                                fprintf(stderr,”This is an error message!\n”);

Users:

When logged onto a UNIX system directly, the user whose name is root has unlimited access to the files on the system. root can also become any other user without having to give a password. root is reserved for the system administrator or trusted user.

                Certain commands are forbidden to normal users. For example, a regular user should not be able to half the system, or change the ownership of files (see next paragraph). These things are reserved for the root or superuser.

Hard link and symbolic link linux

A symbolic link is a pointer or an alias to another file. The command:

                                         ln  –s  fromfile/other/directory/tolink

makes the file fromfile appear to exist at /other/directory/tolink simultaneously. The file is not copied, it merely appears to be a part of the file tree in two places. Symbolic links can be made to both file and directories.

                A symbolic link is just a small file which contains the name of the real file one is interested in. It cannot be opened like an ordinary file, but may be read with the C call readlink()  see (undefined) [lstat and readlink]. Page (undefined). If we remove the file a symbolic link points to, the link remains – it just points nowhere.

                A hard link duplicate inode in the filesystem which is in every way equivalent to the original file inode. If a file is pointed to by a hard link, it cannot be removed until the link is removed. If a file has n hard links –all of them must be removed before the file can be removed. The number of hard links to a file is stored in the filesystem index node for the file.

Difference between UNIX and linux?

1. Linux is a UNIX Clone

Linux is a UNIX clone written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net.

2. Linux Is Just a Kernel

Linux is just a kernel and Linux distribution makes it complete usable operating systems by adding various applications. Most UNIX operating systems comes with A-Z programs such as editor, compilers etc.

3. License and cost

Linux is Free (as in beer [freedom]). You can download it from the Internet or redistribute it under GNU licenses. Most UNIX like operating systems are not free (but this is changing fast, for example OpenSolaris UNIX).

4. User-Friendly

Linux is considered as most user friendly UNIX like operating systems.

5. Security Firewall Software

Linux comes with open source netfilter/iptables based firewall tool to protect your server and desktop from the crackers and hackers. UNIX operating systems comes with its own firewall product or you need to purchase a 3rd party software such as Checkpoint UNIX firewall.

6. Backup and Recovery Software

UNIX and Linux comes with different set of tools for backing up data to tape and other backup media.

7. File Systems in unix and linux

  • Linux by default supports and use ext3 or ext4 file systems.

  • UNIX comes with various file systems such as jfs, gpfs (AIX), jfs, gpfs (HP-UX), jfs, gpfs (Solaris).

UNIX Operating System Names

A few popular names:

  1. HP-UX

  2. IBM AIX

  3. Sun Solaris

  4. Mac OS X

  5. IRIX

Linux Distribution (Operating System) Names

A few popular names:

  1. Redhat Enterprise Linux

  2. Fedora Linux

  3. Debian Linux

  4. Suse Enterprise Linux

  5. Ubuntu Linux

Common Things Between Linux & UNIX

Both share many common applications such as:

  1. GUI, file, and windows managers (KDE, Gnome)

  2. Shells (ksh, csh, bash)

  3. Various office applications such as OpenOffice.org

  4. Development tools (perl, php, python, GNU c/c++ compilers)

  5. Posix interface