UNIX O'System

The word UNIX, written in all upper case (i.e., capital) letters, is generally used to refer to those operating systems which use this term as the entirety of or as part of their official names, including all of the original versions of UNIX that were developed at Bell Labs. It is also used to refer to the UNIX trademark.
When UNIX was first developed, it was a common practice for the names of operating systems to consist of all upper case letters, largely because many computer terminals at the time could not produce lower case (i.e., small) letters. Although UNIX was originally written as Unix (i.e., lower case except for the first letter), the name was soon changed to the all-upper case version, where it remains today, to conform to the naming convention of that era.The use of the word Unix has become increasingly common in recent years, including by some major publishers, as a generic term that refers to all operating systems which incorporate the major features of the early versions of UNIX, whether or not they officially call themselves UNIX or use the UNIX trademark. However, this usage is controversial, and it is not favored by the owners of the UNIX trademark.
The UNIX trademark is owned by The Open Group, an industry consortium that was formed in 1996 from a merger of the Open Software Foundation (OSF) and X/Open Company, Ltd (X/Open). This trademark was acquired by X/Open in 1994 from Novell, Inc., which had purchased it from AT&T (the parent corporation of Bell Labs) the previous year.Reasons cited by its advocates for the lower case version's growth in popularity include the facts that it supposedly looks better and is easier to type. It is also said to help distinguish the generic category from the proprietary names which use the all-upper case version. Moreover, it is shorter and easier to type than the term Unix-like.
Unix-like is commonly used as a generic term referring to all operating systems that incorporate the major features of the early versions of UNIX, whether or not they officially call themselves UNIX or use the UNIX trademark. It is a broader term than Unix in the sense that the addition of the word -like eliminates any claim or implication that any system is UNIX (regardless of how UNIX might be defined, or spelled), and instead merely indicates that a system resembles the original UNIX systems. Thus, it is better at avoiding the controversial issues regarding what is, or can legally be called, UNIX, or Unix.
The Linux Information Project follows the convention of using the term UNIX to refer only to the original versions of the operating system that were developed at Bell Labs, to operating systems which use UNIX as part of their official names and to the UNIX trademark. It generally avoids the use of the word Unix by itself and instead uses Unix-likeas a generic term to refer to all operating systems that resemble the original versions of UNIX as developed at Bell Labs, including those versions of UNIX and Linux.

The UNIX operating system is a set of programs that act as a link between the computer and the user. The computer programs that allocate the system resources and coordinate all the details of the computer's internal is called the operating system or kernel.Users communicate with the kernel through a program known as the shell. The shell is a command line interpreter; it translates commands entered by the user and converts them into a language that is understood by the kernel.
UNIX was originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna.There are various UNIX variants available in the market. Solaris Unix, AIX, UP Unix and BSD are few examples. Linux is also a flavour of Unix which is freely available.
Several people can use a UNIX computer at the same time; hence UNIX is called a multiuser system.A user can also run multiple programs at the same time; hence UNIX is called multitasking.
Here is a basic block diagram of a UNIX system:




The main concept that unites all versions of UNIX is the following four basics:
  • Kernel: The kernel is the heart of the operating system. It interacts with hardware and most of the tasks like memory management, tash scheduling and file management.
  • Shell: The shell is the utility that processes your requests. When you type in a command at your terminal, the shell interprets the command and calls the program that you want. The shell uses standard syntax for all commands. C Shell, Bourne Shell and Korn Shell are most famous shells which are available with most of the Unix variants.
  • Commands and Utilities: There are various command and utilities which you would use in your day to day activities. cp, mv, cat and grep etc. are few examples of commands and utilities. There are over 250 standard commands plus numerous others provided through 3rd party software. All the commands come along with various optional options.
  • Files and Directories: All data in UNIX is organized into files. All files are organized into directories. These directories are organized into a tree-like structure called the filesystem.
Que:- What are the fields of the password file?
Ans:-
/etc/passwd file format:
Username: It is used when user logs in. It should be between 1 and 32 characters in length.
Password: An x character indicates that encrypted password is stored in /etc/shadow file.
User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by system for administrative and system accounts/groups.
Group ID (GID): The primary group ID (stored in /etc/group file)
User ID Info: The comment field. It allow you to add extra information about the users such as user's full name, phone number etc. This field use by finger command.
Home directory: The absolute path to the directory the user will be in when they log in. If this directory does not exists then users directory becomes /
Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this is a shell. Please note that it does not have to be a shell.

/etc/shadow file fields:
User name: It is your login name
Password: It your encrypted password. The password should be minimum 6-8 characters long including special characters/digits
Last password change (lastchanged): Days since Jan 1, 1970 that password was last changed
Minimum: The minimum number of days required between password changes i.e. the number of days left before the user is allowed to change his/her password
Maximum: The maximum number of days the password is valid (after that user is forced to change his/her password)
Warn: The number of days before password is to expire that user is warned that his/her password must be changed
Inactive: The number of days after password expires that account is disabled
Expire: days since Jan 1, 1970 that account is disabled i.e. an absolute date specifying when the login may no longer be used


Que:- What are different directories in / for?
Ans:-
The parts of the root filesystem are:
/bin-- executables (binaries) needed during bootup that might be used by normal users.
/sbin-- executables (system binaries) not intended for use by general users (users may still use them, but this directory is not on their PATH).
/etc--system-wide configuration files for your operating system.
/root-- the home directory of the system administrator (called super-user or root).
/dev-- device files. Devices appear on Linux as files so that hardware is abstracted and it is easy to write to them or read from them.
/mnt-- mount points for removable media (floppy, cdrom, zipdrive), partitions of other operating systems (e.g. MS Windows), network shares, and anything else that is mounted on the file system temporarily. It normally contains a separate subdirectory for each mounting share. The contents of these drives/shares appear in these subdirectories--there are no drive letters on Linux.
/lib-- shared libraries for programs that reside on the root filesystem and kernel modules.
/boot-- files used by the bootstrap loader (LILO or GRUB), the thing that loads first when the computer is booted and perhaps gives you the option of which operating system to boot, if you have more than one OS on your computer). It typically also contains the Linux kernel (compressed, file vmlinuz), but this can be stored somewhere else, if only LILO is configured to know where it is.
/opt-- optional large applications, for example kde under RedHat 5.2 (under RedHat 6.0, kde is distributed as any other X-windows distribution, main executables are in the /usr/bin directory).
/lost+found-- files recovered during the filesystem repair.
/proc-- running "processes". The "everything is a file" paradigm carried to the Linux degree! This folder hosts files which keep tabs on boring stuff like what daemons are running and the process ID of Emacs while you have Emacs open.
/tmp-- "temporary" files, of use by programs which need to throw together a data file on-the-fly in preperation for executing some other task. This folder gets flushed on reboot.
/usr-- "user". Practically a whole other system in here, /usr/bin is still more binaries, /usr/doc and /usr/share/doc are documentation folders, /usr/share/games/fortune is where the funny quotes come from when you log on (if that feature is enabled). The idea is that this should be where files/programs accessible by all users should be, and thus your desktop backgrounds come from /usr/share/wallpapers, or such. The other case is newly installed programs sometimes end up in /usr/local/bin.
/var-- "variable". System logs in here, recording such things as the last foo commands typed at the prompt, start-up boot messages, and such.


Que:- What does a plus at the beginning of a line in the password file signify?
Ans:-
When we setup NIS , NIS+, LDAP server on that time we want to allow or disallow user via +,- ,+name entry in a file.
+ == access to login
- == deny to login
+@ == allow all user of this group to login

Que:- What is an MX record?
Ans: -
MX stands for Mail Exchange Records. MX records are used in DNS records to specify how email should be routed.

Que:- What is the prom command on a Sun that shows the SCSI devices?
Ans:-
Prom:- "ok prompt" one of the main hardware differences between SPARC systems can run only Solaris and PC systems can run Linux, Microsoft Windows. In The SPARC systems we have an OpenBoot PROM monitor program, which can be used to modify firmware settings prior to booting. you can attach or deattach all the SCSI devices from the system by using the probe-scsi command.

Que:- What is DNS?
Ans:-
The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most importantly, it translates domain names meaningful to humans into the numerical identifiers associated with networking equipment for the purpose of locating and addressing these devices worldwide.


Que:- Name a replacement for PHP/Perl/MySQL/Linux/Apache and show main differences.
Ans:-
All the combination of these is called name as LAMP. The LAMP architecture has become popular in the web industry as a way of deploying web applications. PHP is commonly used as the P in this bundle alongside Linux, Apache and MySQL, although the P may also refer to Python or Perl or some combination of the three. WAMP packages (Windows/ Apache/ MySQL / PHP) and MAMP packages (Mac OS X / Apache / MySQL / PHP) are also available.

PHP
PHP is a general-purpose scripting language originally designed for web development to produce dynamic web pages. While PHP originally stood for "Personal Home Page", it is now said to stand for "PHP: Hypertext Preprocessor" A competitor to Microsoft's Active Server Pages (ASP) server-side script engine and similar languages, PHP is installed on more than 20 million websites and 1 million web servers. PHP was originally created by Rasmus Lerdorf in 1995.

Perl
Perl was originally named "Pearl", after the Parable of the Pearl from the Gospel of Matthew. Larry Wall wanted to give the language a short name with positive connotations; he claims that he considered (and rejected) every three- and four-letter word in the dictionary. He also considered naming it after his wife Gloria. Wall discovered the existing PEARL programming language before Perl's official release and changed the spelling of the name. Programming Perl, published by O'Reilly Media, features a picture of a camel on the cover and is commonly referred to as the "Camel Book".

MySQL
MySQL also Commonly "My Sequel" is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It is named after developer Michael Widenius' daughter, My. The SQL phrase stands for Structured Query Language.

Apache
The Apache HTTP Server, commonly referred to as Apache is web server software notable for playing a key role in the initial growth of the World Wide Web. In 2009 it became the first web server software to surpass the 100 million website milestone. Typically Apache is run on a Unix-like operating system. The original author is Robert McCool. And it is written in C Language.

Linux
Yesterday Linux distro vendor Lindows announced it would change its name to Linspire. NewsForge has obtained the super-secret list of other names under consideration that were ultimately rejected:
10. Newbix
9. Lindoze
8. Lindose
7. Linduhs
6. Linploits
5. YADOL (Yet Another Distribution of Linux)
4. Caldera
3. Guidows
2. Lin++
1. Winux

Que: - Why have you chosen such a combination of products?
Ans:-
if I choose a combination of product So, It is easier to develop any things because all the product I choose that are related to our requirements and all the products are provides a good features and all the requirements and compatibility are related to each other products So it also resolve the cost efficiency and many more features. For example I want to develop a web portal So, We use LAMP architecture. It is very useful and it fulfills our all the requirements’ and specification to develop a web portal.
Que:- Differences between two last MySQL versions. Which one would you choose and when/why?
Ans:-
With MySQL 5.5 generally available and being deployed all over the planet, the architects and strategists can start looking ahead to the exciting new thing with "SQL" in its name: MySQL 5.6. MySQL 5.6 builds on the momentum of 5.5, and Oracle's investment and commitment to MySQL, by delivering better performance and scalability. And I choose a Mysql 5.5.x in 2009 because I have it and I enjoy with this.

Que:- Main differences between Apache 1.x and 2.x. Why is 2.x not so popular? Which one would you choose and when/why?
Ans:-
Apache 2 is a better overall design. That being said, 1.3 is a rock. It has been tested for years and is very stable and has few, if any, serious bugs left in the code base. Performance, Depends on the OS and the hardware. Apache2 seems to have a big advantage on any setup favoring heavy threading. I have tested it on a sun T-2000 and it destroys apache1.3. I have been told that it pretty handily wins on almost any windows box as well (But haven’t personally seen this). I know that an options or xenon running FreeBSD doesn’t really care. They both seam to do well when tuned correctly. I stay with 1.3 at the moment as I am still more comfortable with it, and I run a lot of Open BSD and they have done a good amount of code auditing on the 1.3.29 branch that they are using in their default install.

Que:- Which Linux distro do you have experience with?
Ans:-
Distro: (computing) a particular package of software, esp. open-source, for distribution to users.Hardware compatibility, ease of use, the size of a software repository. These three attributes are unique to each Linux distribution. But at the same time, each Linux distribution is at liberty to take and mix whatever it wants from any other.
1. The best distro for beginners: Ubuntu 11.04
2. The best distro for experts: Fedora 15
3. The best distro for customization: Arch
4. The best distro for older hardware: Puppy Linux 5.2.5
5. The best distro for your desktop: Linux Mint 11
6. Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES) etc.

Que:- Which distro you prefer? Why?
Ans:-
I prefer an Ubuntu and Red hat distro Because these are most popular and easy to use. Red Hat Enterprise Linux (RHEL), or simply Red Hat is made by Red hat Inc for commercial purposes. Therefore, it is not free for use unlike Ubuntu.

Que:- Which tool would you use to update Debian / Slackware / RedHat / Mandrake / SuSE ?
Ans:-
up2date tool. up2date, also known as the Red Hat Update Agent, is a tool used by older versions of Red Hat Enterprise Linux, Centos and Fedora Core that downloads and installs new software and upgrades the operating system. It functions as a front-end to the RPM Package Manager and adds advanced features such as automatic dependency resolution. The file /etc/sysconfig/rhn/sources specifies where up2date will search for packages.
Que:- You’re asked to write an Apache module. What would you do?
Ans:-
To include the example module in your server, follow the steps below:
1. Run configure with --enable-example option.
2. Make the server (run "make").
To add another module of your own:
1. cp modules/experimental/mod_example.c modules/new_module/mod_myexample.c
2. Modify the file.
3. Create modules/new_module/config.m4.
  • Add APACHE_MODPATH_INIT(new_module).
  • Copy APACHE_MODULE line with "example" from modules/experimental/config.m4.
  • Replace the first argument "example" with myexample.
  • Replace the second argument with brief description of your module. It will be used in configure --help.
  • If your module needs additional C compiler flags, linker flags or libraries, add them to CFLAGS, LDFLAGS and LIBS accordingly. See other config.m4 files in modules directory for examples.
  • Add APACHE_MODPATH_FINISH.
  • 4. Create module/new_module/Makefile.in. If your module doesn't need special build instructions, all you need to have in that file is include $(top_srcdir)/build/special.mk.
5. Run ./buildconf from the top-level directory.
6. Build the server with --enable-myexample

Que:- Which tool do you prefer for Apache log reports?
Ans:-
1. Nihuo Web Log Analyzer is apache log analyzer software. It provides many powerful Features to analyze apache log file.Support Apache common and combined log format Auto detect log format Support IPV6 Apache log format Integrated with full detailed IP city database.
2. WebLog Expert is a fast and powerful access log analyzer. It will give you information about your site's visitors: activity statistics, accessed files, paths through the site, information about referring pages, search engines, browsers, operating systems, and more. The program produces easy-to-read reports that include both text information (tables) and charts. View the WebLog Expert sample report to get the general idea of the variety of information about your site's usage it can provide.

Que:- Your portfolio. (Even a PHP guest book may work well)
Ans:-
A PHP Guest Book: Gentle Source Guestbook allows you to put a guestbook on your website. Your visitors can sign it and leave a message. The entries can be edited and deleted in the admin area.
  • Visitors can enter a name, e-mail, homepage, comment title and comment text
  • E-Mail notification of new comments
  • Comment moderation
As my portfolio yes, it will work fine but we need to customize it as our requirement and design also U May Fallow this Link: - http://www.phpeasystep.com/phptu/15.html OR U want built-ed file then: - http://www.phpjunkyard.com/download.php Download a file from here.

Que:- What does ‘route’ command do?
Ans:-
In the Solaris OS "route" command is use to manually manipulate the routing table. we add or delete the ipv4 and ipv6 address in the table. After Give the IP address in the table the client can reach his destination through flow the routing path from the table through this client can access the all services and its facility.

Que:- Differences between ipchains and iptables.
Ans:-
These two command are used on Linux Platform like Redhat etc Both ipchains and iptables use chains of rules that operate within the Linux kernel to filter packets based on matches with specified rules or rule sets. However, iptables offers a more extensible way of filtering packets, giving the administrator greater control without building undue complexity into the system.
iptables: The GUI configuration tool /usr/bin/redhat-config-securitylevel can be used to choose a preconfigured firewall (High, Medium or no firewall) or it can be used to manually configure rules based on the network services your server will offer. The init script /etc/rc.d/init.d/iptables will use rules stored in /etc/sysconfig/iptables.
ipchains: The tool that does this is lokkit (or /usr/bin/gnome-lokkit), which uses ipchains to configure firewall options for High and Low security options. To support ipchains after install, run /usr/bin/gnome-lokkit and configure a firewall. It will configure ipchains to activate the firewall. Lokkit will generate the file /etc/sysconfig/ipchains. (Used by init script /etc/rc.d/init.d/ipchains which calls /sbin/ipchains-restore)

Que: - What’s eth0, ppp0, wlan0, ttyS0, etc?
Ans:-
These all are network interface Drivers except ttyS0:-

eth0:- eth0 is your NIC (Network interface card) Ethernet card Driver for access the Network.
ppp0:- Interface ppp0 is the Point to Point Protocol interface number 0. In other words it's what Your modem uses when it connects to your internet service provider (if you have more than one ISP, you'll have interfaces ppp1, ppp2 etc.)
wlan0:- It is a Wireless NIC card driver.
ttyS0:- "tty" Is an abbreviation for "Teletype" and S0 stand for Serial Port number. /dev/ttyS0 is the Special file for the serial port known as COM1 in the DOS/Windows world.
   
Que:- Partitioning scheme for new webserver. Why?
Ans:-
1. It depends a little, when you have a modern computer with a lot of RAM I think putting it behind your Root directory is the best.
2. it’s faster if you have multiple hdd's.
3. Yes.
4. No.
I don't think its necessary to have /boot / /usr /var and /tmp on different partitions.
500mb is very large for /boot anyway (50mb should be enough).
I also think that a total of 70gb for the sum of /boot / /usr /var and /tmp is really unnecessary. I think, since you have /home on a separate partition, 20gb should already be enough.

Que:- What does the /etc Stand for?
Ans:-
Yes, etc stands for " Editable Text Configuration "
It's purpose in life is to host various configuration files from around your system. For instance, to add a new hard drive to your system and have Linux auto-mount it on boot, you'd have to edit /etc/fstab. If you use lynx and don't like the color scheme, you change it in /etc/lynx.conf. And so on...

Que:- What is the major advantage of a hash table?
Ans:-
The major advantage of a hash table is its speed. Because the hash function is to take a range of key values and transform them into index values in such a way that the key values are distributed randomly across all the indices of a hash table.

Que:- What are the techniques that you use to handle the collisions in hash tables?
Ans:-
We can use two major techniques to handle the collisions. They are open addressing and separate chaining. In open addressing, data items that hash to a full array cell are placed in another cell in the array. In separate chaining, each array element consist of a linked list. All data items hashing to a given array index are inserted in that list.

Que:- In Unix OS, what is the file server?
Ans:-
The file server is a machine that shares its disk storage and files with other machines on the network.

Que:- What is NFS? What is its job?
Ans:-
NFS stands for Network File System. NFS enables filesystems physically residing on one computer system to be used by other computers in the network, appearing to users on the remote host as just another local disk.

Que:- What is CVS? List some useful CVS commands.
Ans:-
CVS is Concurrent Version System. It is the front end to the RCS revision control system which extends the notion of revision control from a collection of files in a single directory to a hierarchical collection of directories consisting of revision controlled files. These directories and files can be combined together to form a software release.
There are some useful commands that are being used very often. These are:
cvs checkout
cvs update
cvs add
cvs remove
cvs commit

Que:- What is LILO?
Ans:-
LILO stands for Linux boot loader. It will load the MBR, master boot record, into the memory, and tell the system which partition and hard drive to boot from.

Que:- What is the main advantage of creating links to a file instead of copies of the file?
Ans:-
The main advantage is not really that it saves disk space (though it does that too) but, rather, that a change of permissions on the file is applied to all the link access points. The link will show permissions of lrwxrwxrwx but that is for the link itself and not the access to the file to which the link points. Thus if you want to change the permissions for a command, such as su, you only have to do it on the original. With copies you have to find all of the copies and change permission on each of the copies.

Que:- Write a command to find all of the files which have been accessed within the last 30 days.
Ans:-
find / -type f -atime -30 > December.files
This command will find all the files under root, which is ‘/’, with file type is file. ‘-atime -30' will give all the files accessed less than 30 days ago. And the output will put into a file call December.files.

Que:- What is the most graceful way to get to run level single user mode?
Ans:-
The most graceful way is to use the command init s.
If you want to shut everything down before going to single user mode then do init 0 first and from the ok prompt do a boot -s.

No comments: