Tuesday, June 10, 2008

What is the difference between unix and Linux?

  • Difference between UNIX and Linux:

    That's a very broad question and could be answered any number of ways. Probably the simplest answer is that from a technical point of view there are no major differences. Most people aren't satisfied with believing that Linux and UNIX are very similar, though. Here's a list of the most obvious remaining differences.

    Origin: UNIX originated in the laboratories of universities and large corporations, as an initiative within the context of those organisations. Linux was begun by a university student (Linus Torvalds) without any initial support from any large organisation. Linux also began as in mimickry of other well-known UNIX-like implementations, whereas the initial UNIX implementations were original research. Most commercial UNIX versions are also derived from that early research.

    Service Model: Most UNIX versions operate on the basis that you can buy help (support and service contracts). Although such things are increasingly available to Linux technologists, traditional arrangements consist of providing your own help, with the assistance of a community of like-minded people. Linux is big, and access to communities is more important than, say, it is for IBM mainframes.

    Equipment: Although Linux runs on many kinds of equipment, it is best known for its support of commodity IBM-Intel PC-based hardware. Most of the more popular UNIX flavours focus on high-performance hardware, usually of a proprietory nature, or using high-end standard computing architectures, like SPARC. With ever-increasing gains in PC hardware, like Serial-ATA, this distinction is not as large as it used to be, especially for low performance uses, like desktops.

    Licensing: Linux follows the Free Software Foundation's radical licensing model, which provides a great deal of liberty to those that interact with Linux technology. UNIX versions provided by other vendors have profit strategies embedded in them. People who offer Linux services might have a profit strategy, but Linux itself doesn't. This means that vendor lock-in is less of an issue with Linux than it is with other UNIX offerings. It also means that organisations big enough to have a center of computing competancy always have the choice of "doing it themselves."

    Honesty: Linux and related software is extremely visible. You can find out about flaws before you commit to the technology rather than afterwards. Because of this, a version number in Linux is a more relable indicator of the quality of the software than in UNIX. For example, most Linux software spends a long time being version 0 (zero) before it ever qualifies for the label "version 1."

    In terms of quality, performance and feature set, there's little to separate Linux from the other UNIXes. Linux has yet to provide genuine real-time scheduling, which some other UNIX versions do well.

  • Unix was developed using ‘C’ Language. Unix was the foundation on which Linux was built. Unix has Character based environment while Linux has Graphical as well as Character based environment. Unix has less numbers of utilities & Features as compare to Linux.Ex: Number of shells and editors available in Linux is more than Unix.

What is the difference between kernel and microkernel?

  • micro_kernel: A micro-kernel is a minimal operating system that performs only the essential functions of an operating system. All other operating system functions are performed by system processes.
  • kernel:The kernel is the part of the Operating System(OS) that interacts directly with the hardware of computer ,through device drivers that are built into the kernel. It provides set of services that can be used by programs ,insulating these programs from the underlying hardware.

What is kernel?

  • kernel:The kernel is the part of the Operating System(OS) that interacts directly with the hardware of computer ,through device drivers that are built into the kernel. It provides set of services that can be used by programs ,insulating these programs from the underlying hardware.

    Major functions of kernel are:

    1. to manage computer memory

    2.to control acces to the computer

    3.to maintain file system

    4.to handle interrupts

    5.to handel errors

    6.to perform input and output services(which allows computers to interact with terminals,storage devices and printers) and

    7.to allocate the resources of the computer(such as CPU and input/output devices) among users.

How do i partition the disk under red hat linux?

  • Check hard disk device

    and use the fdisk and the hard disk device name eg /dev/sda

  • cfdisk also good

how do you mount Linux partition on windows

mount -t cifs -o username=root,password=open

ex : mount -t cifs //ntserver/download -o username=
root,password=open /mnt/ntserver

Saturday, May 31, 2008

How do you get current CPU utilization, memory and disk space usage in Linux/Unix?

What are the commands?

  1. quota

    All are allocated a certain amount of disk space on the file system for their personal files, usually about 100Mb. If you go over your quota, you are given 7 days to remove excess files.

    To check your current quota and how much of it you have used, type

    % quota -v

    df

    The df command reports on the space left on the file system. For example, to find out how much space is left on the fileserver, type

    % df .

    du

    The du command outputs the number of kilobyes used by each subdirectory. Useful if you have gone over quota and you want to find out which directory has the most files. In your home-directory, type

    % du

  2. use prstat
  3. For CPU utilization "top" can be used.
thanks to http://www.geekinterview.com/question_details/61146

Is ‘du’ a command? If so, what is its use?

Yes, it stands for ‘disk usage’. With the help of this command you can find the disk capacity and free space of the disk. "du" reports the disk usage by each sub-dir under the current directory.

some of the options for "du" are :

  • du -k : returns the disk usage in KBs

  • du -k : gives the disk usage by direcotry and all its sub-directories in KBs.

"du" does not show the free disk space. Use "df" for this.

Is it possible to create new a file system in UNIX?

  1. Yes, mkfs is used to create a new file system.

    mkfs -t filesystem device name.
    for e.g
    mkfs -f ext3 /dev/hda2

What is relative path and absolute path?

  1. Absolute path : Exact path from root directory.
    Relative path : Relative to the current path.
  2. absolute path is from home directory to user directory..

    but

    relative path is from present working directory to user directory.

    Ex:

    Say, your current working directory is /home/tst

    If there is sub-dir called scripts here, then

    the absolute path for the sub-dir is /home/rama/scripts

    and

    relative path is scripts or ./scripts (relative to /home/rama)

What is the importance of Cascade in CSS?

  1. One doesn't have to declare repeating styles for the child elements. E.g. if body has a font-name style set to Arial, by default all the elements in the HTML document will inherit this property, unless defined separately.

What are the types of CSS rules?

  1. There are three types of CSS rules. They are :
    • HTML Selector
    • Class
    • ID

What is CLASS selector?

  1. Using CLASS selectors in CSS one can assign style information to all elements. Class selectors name in CSS is preceded by full stop.
  2. The class selectors which can be applied multiple times to different element within a page to format content.

What are Inline elements in CSS?

  1. If a user wants to set a particular style for a particular element this can be done using Inline styles by making use of the STYLE attribute. The STYLE attribute is different from style tag. Thus a inline style is applied only to a particular element.

What is external Style Sheet?

  1. External Style sheet is used to control the style of a multiple web pages. By this way we can create the style sheet outside the JSP page and include it in the head section of the jsp.

    link rel="stylesheet" type="text/css" href="style.css"

    An external style sheet (CSS) is perfect - when the same style / format / look n feel is required on numerous pages. With an external style sheet, the webmaster can change the look of the entire site - by changing one file.
  2. External Style Sheet tag is place after the heading tag. this tag purpose is the we can mention the path of the style sheet.

What is the need for CSS?

  • CSS is called as Cascading Style Sheets. This is used to enhance the features of web pages like formatting styles say bold, font size and so on and there by increase the visual appearance of web pages. These are specified inside an HTML tag. The use of CSS reduces time and enhances the web page design. With CSS it is possible to define layout of HTML documents like font, color, margin, line, height, width, images and so on. And another vital factor is CSS is supported by almost all web browsers and thus making it compatible for usage. With HTML one just defines the layout but with CSS added to it only enhances the design of document and thus catches the visual appearance and makes it easier to use for users. Thus the major difference between HTML and CSS will give the need for CSS in short. It is as follows. HTML is a structured content but CSS is used for formatting the structured content. The main need for CSS comes into picture when there was a need for a tool that is supported by all browsers which was achieved by CSS. Not only this in CSS the presentation style of document is separated ort excluded from the content of the document and thus making it much easier for users to understand and there by making it easier for maintenance. Thus in short the major advantages of CSS which led to the need for CSS are given below:

    • Supported by all browsers
    • Many sophisticated techniques available to achieve the formatting
    • Presentation style of document separated from content
    • Easier to Maintain the site
    • Very structured formatted layout achieved.
  • css used to add styles to existing html elements.if you like to change any color or size for any html element ,you can change in one place where css is defined, it will replicate changes to all corresponding html elements instead of changing to all the places.
  • The major use of CSS is to reduce redundancy and increase usability. In other words, you only need one style sheet to standardize the look and feel of the website.
  • If we using CSS for styling a Site insted of Instyle , in a single edit we can change the look and feel of the site. if our pages number is more CSS is necessary
  • CSS helps in faster downloading of the pages. Main benefit is that the styles need to be downloaded only once, on the first page the user visits. The style sheet goes into the cache, and thus need not be downloaded again and again for other pages that use that same cached style sheet.

    Disadvantages of separating style and content is that complex layouts can be difficult to create. for users inexperienced in writing CSS, complex layouts can be difficult to recreate. Additionally, many browsers render certain CSS rules differently than others, meaning that a layout which looks correct in one browser may look quite different in another.