Friday, July 15, 2011
What's New in RHEL 6
Wednesday, June 9, 2010
Overview of Unix operating system
An Overview of the UNIX* Operating System
The UNIX* operating system was designed to let a number of programmers access the computer at the same time and share its resources.The operating system coordinates the use of the computer's resources, allowing one person, for example, to run a spell check program while another creates a document, lets another edit a document while another creates graphics, and lets another user format a document -- all at the same time, with each user oblivious to the activities of the others.
The operating system controls all of the commands from all of the keyboards and all of the data being generated, and permits each user to believe he or she is the only person working on the computer.
This real-time sharing of resources make UNIX one of the most powerful operating systems ever.
Although UNIX was developed by programmers for programmers, it provides an environment so powerful and flexible that it is found in businesses, sciences, academia, and industry. Many telecommunications switches and transmission systems also are controlled by administration and maintenance systems based on UNIX.
While initially designed for medium-sized minicomputers, the operating system was soon moved to larger, more powerful mainframe computers. As personal computers grew in popularity, versions of UNIX found their way into these boxes, and a number of companies produce UNIX-based machines for the scientific and programming communities.
The uniqueness of UNIX
The features that made UNIX a hit from the start are:- Multitasking capability
- Multiuser capability
- Portability
- UNIX programs
- Library of application software
Multitasking
Many computers do just one thing at a time, as anyone who uses a PC or laptop can attest. Try logging onto your company's network while opening your browser while opening a word processing program. Chances are the processor will freeze for a few seconds while it sorts out the multiple instructions.UNIX, on the other hand, lets a computer do several things at once, such as printing out one file while the user edits another file. This is a major feature for users, since users don't have to wait for one application to end before starting another one.
Multiusers
The same design that permits multitasking permits multiple users to use the computer. The computer can take the commands of a number of users -- determined by the design of the computer -- to run programs, access files, and print documents at the same time.The computer can't tell the printer to print all the requests at once, but it does prioritize the requests to keep everything orderly. It also lets several users access the same document by compartmentalizing the document so that the changes of one user don't override the changes of another user.
System portability
A major contribution of the UNIX system was its portability, permitting it to move from one brand of computer to another with a minimum of code changes. At a time when different computer lines of the same vendor didn't talk to each other -- yet alone machines of multiple vendors -- that meant a great savings in both hardware and software upgrades.It also meant that the operating system could be upgraded without having all the customer's data inputted again. And new versions of UNIX were backward compatible with older versions, making it easier for companies to upgrade in an orderly manner.
UNIX tools
UNIX comes with hundreds of programs that can divided into two classes:- Integral utilities that are absolutely necessary for the operation of the computer, such as the command interpreter, and
- Tools that aren't necessary for the operation of UNIX but provide the user with additional capabilities, such as typesetting capabilities and e-mail.
Tools can be added or removed from a UNIX system, depending upon the applications required.
UNIX Communications
E-mail is commonplace today, but it has only come into its own in the business community within the last 10 years. Not so with UNIX users, who have been enjoying e-mail for several decades.UNIX e-mail at first permitted users on the same computer to communicate with each other via their terminals. Then users on different machines, even made by different vendors, were connected to support e-mail. And finally, UNIX systems around the world were linked into a world wide web decades before the development of today's World Wide Web.
Applications libraries
UNIX as it is known today didn't just develop overnight. Nor were just a few people responsible for it's growth. As soon as it moved from Bell Labs into the universities, every computer programmer worth his or her own salt started developing programs for UNIX.Today there are hundreds of UNIX applications that can be purchased from third-party vendors, in addition to the applications that come with UNIX.
How UNIX is organized
The UNIX system is functionally organized at three levels:- The kernel, which schedules tasks and manages storage;
- The shell, which connects and interprets users' commands, calls programs from memory, and executes them; and
- The tools and applications that offer additional functionality to the operating system
The kernel
The heart of the operating system, the kernel controls the hardware and turns part of the system on and off at the programer's command. If you ask the computer to list (ls) all the files in a directory, the kernel tells the computer to read all the files in that directory from the disk and display them on your screen.The shell
There are several types of shell, most notably the command driven Bourne Shell and the C Shell (no pun intended), and menu-driven shells that make it easier for beginners to use. Whatever shell is used, its purpose remains the same -- to act as an interpreter between the user and the computer.The shell also provides the functionality of "pipes," whereby a number of commands can be linked together by a user, permitting the output of one program to become the input to another program.
Tools and applications
There are hundreds of tools available to UNIX users, although some have been written by third party vendors for specific applications. Typically, tools are grouped into categories for certain functions, such as word processing, business applications, or programming.Friday, June 4, 2010
Why Penguin as a logo for Linux ?
Thursday, June 3, 2010
Linux Basic commands and Information (Part 1)
If you are comfortable at the DOS prompt, you should see a lot of similarities in Linux; if most of your experience has been in Windows, the command line may seem a little awkward at first.
Remember that Linux has an hierarchical, unified filesystem (directories within directories; and files, directories, and device drivers are treated as files), supports 256-character filenames (avoid symbols and punctuation except for the dot (.) and note that you can have more than one nonadjacent dots in the filename - e.g. this.is.okay). All command line entries are case sensitive.
Also note that Linux uses the slash (/) rather than the backslash (\) you've been using in DOS.
There is extensive online help available on any command on your system called the man pages (or manual pages); type in man CommandInQuestion to get a summary of what the command does and a brief summary of the options. Unfortunately, using the man pages is not an efficient or effective way to learn Unix commands, but is often helpful with syntax.
Linux, like all Unix, assumes you know what you're doing and that you do not make typographical errors. Linux, like all Unix, will execute whatever command you give it - all that matters is that it's a valid command. If it's not what you intended, that's your mistake, so don't blame it on the operating system! This operating system allows you to do your work without constantly nagging you.
There are four types of file:ordinary files - text files (plain vanilla ASCII), data files (contain special characters not contained in the ASCII set you are familiar with), command text files (shell scripts), and executable files (binaries); directories; links (we'll get into this below); special device files (physical hardware)
The main subdirectories (and contents) are:/bin - binary files; /boot - information need to boot the system; /cdrom - your CD-ROM drive; (/dos) - your DOS partition; /dev - device drivers; /etc - miscellaneous files (mostly system administration); /home - home directories for users; /lib - programming libraries; /tmp - temporary files; /usr - commands; /var - files that define the system.
(There may be some slight differences between distributions.)
Prompt
If you login as root, the prompt will be machinename:~# and if you login as user, the prompt will be machinename:~$.
The tilde character (~) represents the home directory; appended to the end of a filename, it means a backup of a file that has been edited (the file as it existed before it was last edited, and if your configuration is set up to make backups).
Shell Account
How to Explore Your Shell Account
So you’re in your shell account. You’ve tried the “ls -alF” command and are pretty sure this really, truly is a shell account. What do you do next?
A good place to start is to find out what kind of shell you have. There are many shells, each of which has slightly different ways of working. To do this, at your prompt give the command “echo $SHELL.” Be sure to type in the same lower case and upper case letters. If you were to give the
command ECHO $shell, for example, this command won’t work.
If you get the response:
/bin/sh
That means you have the Bourne shell.
If you get:
/bin/bash
Then you are in the Bourne Again (bash) shell.
If you get:
/bin/ksh
You have the Korn shell.
If the “echo $SHELL” command doesn’t work, try the command “echo $shell,” remembering to use lower case for “shell.” This will likely get you the
answer:
/bin/csh
This means you have the C shell.
Why is it important to know which shell you have? For right now, you’ll want a shell that is easy to use. For example, when you make a mistake in typing, it’s nice to hit the backspace key and not see ^H^H^H on your screen. Later, though, for running those super hacker exploits, the C
shell may be better for you. Fortunately, you may not be stuck with whatever shell you have when you log in. If your shell account is any good, you will have a choice of shells. Trust me, if you are a beginner, you will find bash to be the easiest shell to use. You may be able to get the bash shell by simply typing the word “bash” at the prompt. If this doesn’t work, ask tech support at your ISP for a shell account set up to use bash. If you want to find out what other shells you have the right to use, try “csh” to get the C shell; “ksh” to get the Korn shell, “sh” for Bourne shell, “tcsh” for the Tcsh shell, and “zsh” for the Zsh shell. If you don’t have one of them, when you give the command to get into that shell you will get back the answer “command not found.” Now that you have chosen your shell, the next thing is to explore. See
what riches your ISP has allowed you to use. For that you will want to learn, and I mean *really learn* your most important Unix commands and auxiliary programs. Because I am supreme arbiter of what goes into these Guides, I get to decide what the most important commands are. Hmm, “ten” sounds like a famous number.
So you’re going to get the:
Ten Meinel Hall of Fame Shell Account Exploration Tools
1) man
This magic command brings up the online Unix manual. Use it on each of the commands below, today! Wonder what all the man command options are? Try the"man -k" option.
2) ls
Lists files. I suggest getting people in the habit of using "ls -alF". This will come into play down the road for security-conscious users.” You’ll see a huge list of files that you can’t see with the “ls” command alone, and lots of details. If you see such a long list of files that they scroll off the terminal screen, one way to solve the problem is to use “ls -alFmore.”
3) pwd
Shows what directory you are in.
4) cd
Changes directories. Kewl directories to check out include /usr, /bin and /etc. For laughs, I advise exploring in /tmp. Changes directories. Kewl directories to check out include /usr, /bin and /etc. /usr directory belongs to the accounts, /bin belongs to the commands
and executable programs/files, and /tmp of course, the temporary directory.
5) more
This shows the contents of text files. Also you might be able to find “less” and “cat” which are similar commands.
6) whereis
Think there might be a nifty program hidden somewhere? Maybe a game you love? This will find it for you. Similar commands are “find” and “locate.” Try them all for extra fun.
7) vi
An editing program. You’ll need it to make your own files and when you start programming while in your shell account. You can use it to write a lurid file for people to read when they finger you. Or try “emacs.” It’s another editing program and IMHO more fun than vi. Other editing programs you may find include “ed” (an ancient editing program which I have used to
write thousands of lines of Fortran 77 code), “ex,” “fmt,” “gmacs,” you may find include “ed” (an ancient editing program which I have used to write thousands of lines of Fortran 77 code), “ex,” “fmt,” “gmacs,” “gnuemacs,” and “pico.”
8) grep
Extracts information from files, especially useful for seeing what’s in syslog and shell log files. Similar commands are “egrep,” “fgrep,” and “look.”
9) chmod
Change file permissions.
10) rm
Delete file. If you have this command you should also find “cp” for copy file, and “mv” for move file. LAN and Internet exploration tools
1) telnet
Telnet allows you to login remotely from a remote computer to a host server running any unix or unix clone system. Other variation is called RLOGIN/rlogin. A newer variation also allows you to login more securely using the secure shell (SSH).
2) who
Shows you who else is currently logged in on your ISP’s LAN. Other good commands to explore the other users on your LAN are “w,” “rwho, ” “users.”
3) netstat
All sorts of statistics on your LAN, including all Internet connections. For real fun, try “netstat -r” to see the kernel routing table. However, be careful. I was teaching a friend the basics of summing up a Unix system and I told her to do that and ‘ifconfig’. She was booted off the
system the next day for ‘hacker suspicion’ even though both are legitimate commands for users.”
4) whois
Get lots of information on Internet hosts outside you LAN.
5) nslookup
Get a whole bunch more information on other Internet hosts.
6) dig
Even more info on other Internet hosts. Nslookup and dig are not redundant. Try to get a shell account that lets you use both.
7) finger
Not only can you use finger inside your LAN. It will sometimes get you valuable information about users on other Internet hosts.
8) ping
Find out if a distant computer is alive and run diagnostic tests -- or just plain be a meanie and clobber people with pings. (I strongly advise *against* using ping to annoy or harm others.)
9) traceroute
Kind of like ping with attitude. Maps Internet connections, reveals routers and boxes running firewalls.
10) ftp
Use it to upload and download files to and from other computers. Once you get your shell account, you will probably want to supplement the “man” command with a good Unix book .
Listing Directories
If you are using bash - the Bourne Again Shell - you can get a listing with dir, or ls (with any shell). The default is to list files in alphabetical order (capitals and numbers first)
Some of the most useful options with ls are: -
a - lists all files, including hidden files; -A - lists all files, except the current and parent directory; -c - sorts file by time (oldest first); -d - lists only the name of a directory, not its contents; -l - lists in long format (showing permissions and other details); -r - lists in reverse order; -t - sorts files by time (newest first); -x - lists all files across the page instead of in columns. Reading from the far right you have the links, filename, date and time the file was last modified, the file size (in bytes), the name of the group and owner. The number to the immediate left of the owner is the number of links to the file. (Links will be discussed below, so for the time being think of it as a way for one copy of a file to appear to be in several locations.) The long group of letters and hyphens on the left are the permissions. One of the first things you should learn is about navigating through the directories. As in DOS, the current directory is represented by a single dot (.); the parent directory is represented by double dots (..). The command for change directory is cd so let's go to a more interesting directory such as /etc for some examples. cd /etc ls -lThis directory is mostly system administration files, but run ls -l and one of the first things you'll notice is that the listing is very long. (To page back through the listing use Shift+PageUp; to page down use Shift+PageDown.) Near the top of the listing is X11 with a hyphen and greater than symbol (->; sort of like an arrow) and /var/X11R6/lib/ indicating a link to that location; also notice that the permissions begin with an l, while most begin with a hyphen (-) indicating a file, and some permissions begin with a d indicating a directory. cd /bin ls -lAll the files here are binaries and end with an asterisk (*). cd ~ls -aThere are hidden files beginning with a dot (.); usually your configuration files and files derived from your configuration, e.g. .bash.history
Permissions
For security reasons, all Unix systems including Linux have file permissions which allow you to control access to directories - who can read, write, or execute a file or command in a directory.
In the extreme left is either a d or hyphen (-) indicating whether this is a directory or a file (occasionally you will also see an l indicating a link). Then you see three groups of the same three letters in the same order: r for read, w for write, x for execute, and the hyphen (-) for no permission given in that type.
The first group of three letters is for the owner, the second group for the group, and the third the world. Whoever creates the file is the owner, and if more than one person is working on a project or needs access to this file they are given permission as a group, and finally how the file is open to anyone who has access to the system (the world). chmod, chown, chgrpThe command to change file permissions is chmod (change mode). There are two ways for doing this: the numeric system and the symbolic system. The numeric system uses numbers to track permissions. Using the table below you add together the numeric equivalent for the permissions you want.
400 - owner has read permission 200 - owner has write permission 100 - owner has execute permission
040 - group has read permission 020 - group has write permission 010 - group has execute permission
004 - world has read permission 002 - world has write permission 001 - world has execute permission
Thus chmod 764 SomeFile gives the owner permission to read, write, and execute SomeFile; the group has permission to read and write; the world permission to read only.
The other method for changing modes is the symbolic method. With this method, you have to know the existing permissions because the commands are added or removed relative to how permissions are currently set. The plus sign (+) adds a permission, the minus sign (-) removes a permission. u - user (owner) g - group o - other (world) a - everyone - user, group, and otherr - read permission w - write permission x - execute permissiont - sticky bitThus chmod g+x SomeFile gives permission to the group to execute SomeFile. In the past Unix crackers used to get around the permissions by messing around with entire directories.
The way to prevent this is to set restrictive permissions for the directory using the sticky bit, which makes the directory accessible only to the owner and root without affecting how the individual file permissions are set. chmod -t TheDirectoryYou can also change the owner with the chown command, and change the group with chgrp.
Linking Files
Rather than having multiple copies of a file, Linux uses linking to one file to save disk space and administrative headaches trying to keep multiple copies up to date and synchronized. Linux supports two types of links, hard links and symbolic links. Hard links are set with the command ln FileName /NewDirectoryLocationThe problem with hard links is that Linux treats all hard links equally, and before you can delete the original file, you have to remove all hard links. On the other hand, symbolic links don't need to be physically removed in order to delete the file. (There are some other differences between hard links and symbolic links, but irrelevant to this discussion; consult the man pages.)
Wildcards
Linux has three types of wildcards - the question mark (?), which is used to match a single character, the same as in DOS; the asterisk (*), which is much more expansive than anything in DOS because it can be used to return any number of letters at the beginning or end of an expression; and the final wildcard used to return specific characters as defined within brackets ([ ]).
Processes
A shell acts as the intermediary between the user and the operating system, interpreting your commands into a form the operating system can understand. The shell has the capacity to run multiple commands at one time, and can run commands in the background using the ampersand (&) after the command. Multiple requests to the shell are called processes. As these requests are made, beginning with init during boot, the shell numbers them. These numbers are important if you want to stop a process: use the command ps to to see a list of current processes, then the command kill and the number of the process you want to stop.
Wednesday, June 2, 2010
Extended 4 file system - EXT4
It was born as a series of backward compatible extensions to remove 64-bit storage limits and add other performance improvements to ext3. However, other Linux kernel developers opposed accepting extensions to ext3 for stability reasons, and proposed to fork the source code of ext3, rename it as ext4, and do all the development there, without affecting the current ext3 users. This proposal was accepted, and on 28 June 2006, Theodore Ts'o, the ext3 maintainer, announced the new plan of development for ext4.
A preliminary development snapshot of ext4 was included in version 2.6.19 of the Linux kernel. On 11 October 2008, the patches that mark ext4 as stable code were merged in the Linux 2.6.28 source code repositories, denoting the end of the development phase and recommending ext4 adoption. Kernel 2.6.28, containing the ext4 filesystem, was finally released on 25 December 2008.
- On 15 January 2010, Google announced that it would upgrade its storage infrastructure from ext2 to ext4.
Large file system
The ext4 filesystem can support volumes with sizes up to 1 exabyte and files with sizes up to 16 terabytes. The current e2fsprogs can only handle a filesystem of 16 TB. Work is in progress at pu branch of e2fsprogs.
Extents
Extents are introduced to replace the traditional block mapping scheme used by ext2/3 filesystems. An extent is a range of contiguous physical blocks, improving large file performance and reducing fragmentation. A single extent in ext4 can map up to 128 MB of contiguous space with a 4 KB block size. There can be 4 extents stored in the inode. When there are more than 4 extents to a file, the rest of the extents are indexed in an Htree.
Backward compatibility
The ext4 filesystem is backward compatible with ext3 and ext2, making it possible to mount ext3 and ext2 filesystems as ext4. This will already slightly improve performance, because certain new features of ext4 can also be used with ext3 and ext2, such as the new block allocation algorithm.
The ext3 file system is partially forward compatible with ext4, that is, an ext4 filesystem can be mounted as an ext3 partition (using "ext3" as the filesystem type when mounting). However, if the ext4 partition uses extents (a major new feature of ext4), then the ability to mount the file system as ext3 is lost.
Persistent pre-allocation
The ext4 filesystem allows for pre-allocation of on-disk space for a file. The current method for this on most file systems is to write the file full of 0s to reserve the space when the file is created. This method would no longer be required for ext4; instead, a new fallocate() system call was added to the Linux kernel for use by filesystems, including ext4 and XFS, that have this capability. The space allocated for files such as these would be guaranteed and would likely be contiguous. This has applications for media streaming and databases.
Delayed allocation
Ext4 uses a filesystem performance technique called allocate-on-flush, also known as delayed allocation. It consists of delaying block allocation until the data is going to be written to the disk, unlike some other file systems, which may allocate the necessary blocks before that step. This improves performance and reduces fragmentation by improving block allocation decisions based on the actual file size.
Break 32,000 subdirectory limit
In ext3 the number of subdirectories that a directory can contain is limited to 32,000. This limit has been raised to 64,000 in ext4, and with the "dir_nlink" feature it can go beyond this (although it will stop increasing the link count on the parent). To allow for continued performance given the possibility of much larger directories, Htree indexes (a specialized version of a B-tree) are turned on by default in ext4. This feature is implemented in Linux kernel 2.6.23. Htree is also available in ext3 when the dir_index feature is enabled.
Journal checksumming
Ext4 uses checksums in the journal to improve reliability, since the journal is one of the most used files of the disk. This feature has a side benefit; it can safely avoid a disk I/O wait during the journaling process, improving performance slightly. The technique of journal checksumming was inspired by a research paper from the University of Wisconsin titled IRON File Systems (specifically, section 6, called "transaction checksums").
Faster file system checking
In ext4, unallocated block groups and sections of the inode table are marked as such. This enables e2fsck to skip them entirely on a check and greatly reduces the time it takes to check a file system of the size ext4 is built to support. This feature is implemented in version 2.6.24 of the Linux kernel.
Multiblock allocator
When a file is being appended to, ext3 calls the block allocator once for each block individually; with multiple concurrent writers, files can easily become fragmented on disk. With delayed allocation, however, ext4 buffers up a larger amount of data, and then allocates a group of blocks in a batch. This means that the allocator has more information about what's being written and can make better choices for allocating files contiguously on disk. The multiblock allocator is used when delayed allocation is enabled for a file system, or when files are opened in O_DIRECT mode. This feature does not affect the disk format.
Improved timestamps
As computers become faster in general and as Linux becomes used more for mission critical applications, the granularity of second-based timestamps becomes insufficient. To solve this, ext4 provides timestamps measured in nanoseconds. In addition, 2 bits of the expanded timestamp field are added to the most significant bits of the seconds field of the timestamps to defer the year 2038 problem for an additional 204 years.
Ext4 also adds support for date-created timestamps. But, as Theodore Ts'o points out, while it is easy to add an extra creation-date field in the inode (thus technically enabling support for date-created timestamps in ext4), it is more difficult to modify or add the necessary system calls, like stat() (which would probably require a new version), and the various libraries that depend on them (like glibc). These changes would require coordination of many projects. So, even if ext4 developers implement initial support for creation-date timestamps, this feature will not be available to user programs for now.
Because delayed allocation changes the behavior that programmers have been relying on with ext3, the feature poses some additional risk of data loss in cases where the system crashes or loses power before all of the data has been written to disk. Other Linux file systems like XFS have never offered ext3-like behavior. Due to this, ext4 in kernel versions 2.6.30 and later automatically detects these cases and reverts to the old behavior.
The typical scenario in which this might occur is a program replacing the contents of a file without forcing a write to the disk with fsync. There are two common ways of replacing the contents of a file on Unix systems:
- open("file", O_TRUNC); write(fd, data); close(fd);
In this case, an existing file is truncated at the time of open (due to O_TRUNC flag), then new data is written out. Since the write can take some time, there is an opportunity of losing contents even with ext3, but usually very small. However, because ext4 can delay allocating file data for a long time, this opportunity is much greater.
- open("file.new"); write(fd, data); close(fd); rename ("file.new", "file");
A new temporary file ("file.new") is created, which initially contains the new contents. Then the new file is renamed over the old one. Replacing files by the "rename" call is guaranteed to be atomic by POSIX standards – i.e. either the old file remains, or it's overwritten with the new one. Because the ext3 default "ordered" journalling mode guarantees file data is written out on disk before metadata, this technique guarantees that either the old or the new file contents will persist on disk. ext4's delayed allocation breaks this expectation, because the file write can be delayed for a long time, and the rename is usually carried out before new file contents reach the disk.
Using fsync more often to reduce the risk for ext4 could lead to severe performance penalties on ext3 filesystems mounted with the data=ordered flag (the default on most Linux distributions). Given that both file systems will be in use for some time, this complicates matters enormously for end-user application developers. In response, ext4 in Linux kernels 2.6.30 and newer detect the occurrence of these common cases and force the files to be allocated immediately. For a small cost in performance, this provides semantics similar to ext3 ordered mode and increases the chance that either version of the file will survive the crash. This new behavior is enabled by default, but can be disabled with the "noauto_da_alloc" mount option.
The new patches have become part of the mainline kernel 2.6.30, but various distributions chose to backport them to 2.6.28 or 2.6.29. For instance Ubuntu made them part of the 2.6.28 kernel in version 9.04 ("Jaunty Jackalope").
Linux News (02/06/2010) RHEL 6 Beta
Red Hat Enterprise Linux 6 Beta is the next generation of the Red Hat Enterprise Linux platform. Red Hat Enterprise Linux 6 blurs the lines between virtual, physical, and cloud computing to address shifts taking place in the modern IT environment. Featuring updated core technology, from the kernel to the application infrastructure to the development toolchain, Red Hat Enterprise Linux 6 is designed to meet the needs of the coming generations of hardware and software technologies.
The Red Hat Enterprise Linux 6 Beta is available on the following architectures:
- i386
- AMD64/Intel64
- System z
- IBM Power (64-bit)
The following are some of the many improvements and new features that are included in Red Hat Enterprise Linux 6 Beta:
Power management: tickless kernel and improvements through the application stack to reduce wakeups, power consumption measurement by Powertop, Power Management (ASPM, ALPM), and adaptive system tuning by Tuned, all enhance more efficient system power usage.
Next generation networking: comprehensive IPv6 support (NFS 4, CIFS, mobile support [RFC 3775], ISATAP support), FCoE, iSCSI, and a new and improved mac 802.11 wireless stack.
Reliability, availability, and serviceability (RAS): system-level enhancements from industry collaborations make the most of hardware RAS capabilities and NUMA architectures.
Fine-grained control and management: improved scheduler and better resource management in the kernel via Completely Fair Scheduler (CFS) and Control Groups (CG).
Scalable filesystems: ext4 file system provides support for larger file sizes and significantly reduces repair times over ext3. XFS® is a high-performance file system that supports extremely large files and is optimized for large data transfers.
Virtualization: KVM includes performance improvements and new features, sVirt protects the guest and host from unauthorized access, SR-IOV and NPIV deliver high-performance virtual use of physical devices, and libvirt leverages kernel resource management functionality.
Enterprise security enhancement: SELinux includes improved ease of use, application sandboxing, and significantly increased coverage of system services, while SSSD provides unified access to identity and authentication services as well as caching for off-line use.
Development and runtime support: SystemTap improvements, ABRT is a new framework for simple collection and reporting of bug information, and improvements are made to GCC (version 4.4.3), glibc (version 2.11.1), and GDB (version 7.0.1).
For clear understanding, notes and manuals, please visit the below site
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6-Beta/html/Beta_Release_Notes/
Tuesday, September 1, 2009
RH 033 Part 2
Types of Users
1. Root User : User ID (UID) and Group ID (GID) are same and it is ‘0’
2. System Users : UID and GID are in between 1 to 499 (deamons or processes)
3. Normal Users : UID and GID are in between 500 to 60,000
//All the above said values are by default//
We can grab this information in the file /etc/passwd
To create user for example
# userad sasi
# passwd sasi

Above table defines the permissions for a user on normal file or directory file as per umask (detailed explanation in RH 133) value
i.e. 644 for a file and 755 for a directory
6 – read+write, 5 – read+execute and 4 – read only and 1 - execute
So 644 => owner have read and write, Group have read and Others also have read permissions.
To change the permissions, we have 2 types
Symbolic and Numeric
Symbolic: -
r – read u – owner of the file
w – write g – group
e – execute o – others
a – combination of u, g and o
‘+ ‘- to add permission
‘- ‘- to remove permission
‘=’ – to assign permission
# chmod //command to change the permission for file and directory//
Example: -
# chmod u-w+x, g+w, o+x
The above command will remove write and add execute permissions for owner and
add write permissions to group and add execute permissions to others.
And # chmod a-r
And # chmod a = -
Numeric: -
r – 4 Numbers 1 to 7
w – 2 x – 1, w – 2, wx – 3, r – 4, rx – 5, rw – 6, rwx - 7
e - 1
Ex: - # chmod 777
For a file: -
Default permissions of root user – 644
Default permissions of normal user – 664
For a directory: -
Default permissions of root user – 755
Default permissions of normal user – 775
# chown //is the command to change the user permissions for a file or directory//
Ex: - # chown Sasi file5 //now user Sasi is the owner of the file – file5//
To check the same # ls –l Sasi
# chgrp Sasi file6 //to change the user Sasi as a group for the specified file6//
# chown root:root file7 //to change owner and group at a time//
Standard Input and Output PIPES
0 – input device specifier - Keyboard
1 - output device specifier – Monitor
2 – error redirection
If we press something on the key board, then 0 will be append and then confirms that something coming from keyboard //input – askey to binary and binary to askey//
Ø Input redirection (Symbol ‘<’) Ex: - # cat <>’)
Ex: - # ls –l > file10 //to display the output of ‘ls –l’ command in a new file – file10//
Ø Error redirection
If we know that the command is wrong and gives the error, and we would like to append the
output in a file then do
# call 2> file11
Also if the output is right or wrong, in both the cases we can append the output in a file as
# call &> file12
PIPES
Output of the first command will be the input for the second command
Ex: - # ls –l wc
# cat file13 sort –n
# cat file14 sort uniq //uniq is the command to delete duplicate words//

Tee
Tee is the command to display the out of the file on the monitor for 1 time and save the
output in a file.
Ex: - # cat file15 tee file16 sort tee file17 uniq tee file18
Tip: - # echo $? //to display exit states of a command//
Text processing tools
1) cat: - concord nation of 2 or more files
Ex: - # cat file1 file2 file3
2) less: - pager programme *To see the big file as pages
Ex: - # less file1
Use ‘enter’ key to see line after line
Use ‘spacebar’ key to see page after page
Use /keyword – to search particular words in that file page (It will highlight)
Use arrow keys to move also
3) more: - Same like ‘less’ command, but here we cannot use arrow keys
4) head: - By default it displays first 2 lines of a file
Ex: - # head /etc/passwd
Suppose if we want to see according to our requirement, then we can give the
number in the command as follow,
# head 3 /etc/passwd //to display first 3 lines//
5) tail: - opposite to the command ‘head’
By default this command displays the last 10 lines of a file.
# tail /etc/passwd
6) grep: - To search some pattern
Ex: - # grep
# grep root /etc/passwd
# date grep 10
# grep –v root file8 //to display the pattern which is not having the word ‘root’//
# grep –n root /etc/passwd //switch ‘-n’ means number -
- number of lines where the root pattern is matching//
Useful switches here: - ‘-c to count the lines, -cv and –nv are same as the above examples//
7) sort: - for sorting lines of text files
# sort –n //numeric sorting - compare according to string numerical value//
# sort – g //genaral numeric sorting - compare according to general numerical value//
# sort – r //reverse sorting - reverse the result of comparisons//
# sort –nr //numaric and reverse//
8) uniq: - to remove all continiously repeated words
# uniq –u file3 //to filter duplicates//
# uniq –d file4 //to display only duplicate ones//
9) sed: - stream editor – to search some pattern and replace with other
sed is a stream editor. A stream editor is used to perform basic text transformations on an input
stream (a file or input from a pipeline). While in some ways similar to an editor which permits
scripted edits (such as ed), sed works by making only one pass over the input(s), and is consequently
more efficient. But it is sed's ability to filter text in a pipeline which particularly distinguishes it
from other types of editors
Ex: - # sed ‘s/kw/kw/’ file2
Suppose we want to replace only in particular line number then do
# sed ‘4s/kw/kw/’ file 3 //4 is line number//
but this will replace only first word in every line. If we want to replace all the words then do
# sed ‘s/kw/kw/8 file 4 //8 means globally//
Suppose if we need multiple replacements then do
# sed –e ‘s/roo/ttt/’ –e ‘s/login/ttt/’ file 5
10) wc: - word count
Ex: - # wc –c file2 //to count characters in a file//
Like the above we have switches –w for words and many more//
11) tr: - translate or delete characters
Ex: - # tr ‘a-z’ ‘A-Z’ < /etc/passwd # tr ‘:’ ‘*’ < /etc/passwd //here only one symbol or character will work// 12) aspell check: - to check the spelling with in file //for perminant changes// Ex: - # aspell check file1
Editors
VI editor
We have multiple mode over here, they are
Command mode, insert mode, execution mode and visual mode
Ex: - # vi file1 //will enter in to command mode//
Then press i, it will come to insertion mode. Then press escape key, it will be in execution mode.
In execution mode we have some commands like
:wq //here : means execution mode//
:w //w means save//
:q //exit the file with out saving//
:wq //save and exit//
:q! //force quit//
:wq! //force save and quit//
Command Mode: -
1. Use arroe keys to move curser up, down, right and left in the file
2. Use H in place of left arrow, K in place of up arrow, L in place of right arrow, J in place of down arrow.
3. Use yy (yank) to copy the line
4. Use dd to delete the line and use P to paste the content
5. Use CC to cut the line
6. Use command: ZZ to Save changes and quit
7. Use U to udo the action
8. Press W to move word by word forward and B for backward
9. Use braces ( to move sentense by sentense backward and ) for forward
10. Use braces { to move paragraph by paragraph backward and } fro forward
11. Use o to open a new line below the curser position
12. Use O (upper case) to open a new line above the curser position
13. Use A (upper case) to go to end of the line
14. Use I (upper case) to go to starting of the line
15. Use G (upper case) to Move cursor to end of file
16. Use combination of all the above keys if necessary like below
Y( and Y).
17. Use ‘set nu’ to set the line numbers and ‘set nonu’ to remove the line numbers
To replace the words in the insertion mode use below for example
:1,4s/root/redhat/g //from 1 to 4 lines replacing the word root with redhat//
us :% if we required to do the change in entire file.
The below table will explain some other functions
h/j/k/l to Move cursor left/down/up/right
spacebar to Move cursor right one space
-/+ to Move cursor down/up in first column
ctrl-d to Scroll down one half of a page
ctrl-u to Scroll up one half of a page
ctrl-f to Scroll forward one page
ctrl-b to Scroll back one page
M (shift-h) to move cursor to middle of page
H to move cursor to top of page
L to move cursor to bottom of page
W to move cursor a word at a time
w5w to move cursor ahead 5 words
B to move cursor back a word at a time
b to move cursor back a word at a time
5b to move cursor back 5 words
e to move cursor to end of word
5e to move cursor ahead to the end of the 5th word
0 (zero) to move cursor to beginning of line
$ to move cursor to end of line
) to move cursor to beginning of next sentence
( to move cursor to beginning of current sentence
G to move cursor to end of file
% to move cursor to the matching bracket.Place cursor on {}[]() and type "%".
'. to move cursor to previously modified line.
'a to move cursor to line mark "a" generated by marking with keystroke "ma"
'A to move cursor to line mark "a" (global between buffers) generated by
marking with keystroke "mA"
]' to move cursor to next lower case mark.
[' to move cursor to previous lower case mark.
Editing commands:
i - Insert at cursor
a - Append after cursor
A - Append at end of line
ESC - Terminate insert mode
u - Undo last change
U - Undo all changes to entire line
o - Open a new line
dd - Delete line
3dd - Delete 3 lines.
D - Delete contents of line after cursor
C - Delete contents of line after cursor and insert new text.
Press esc key to end insertion.
dw - delete word
4dw to delete 4 words
cw to change word
x to delete character at cursor
r to replace character
R to overwrite characters from cursor onward
s to substitute one character under cursor continue to insert
S to substitute entire line and begin to insert at beginning of line
~ to change case of individual character
ctrl-a to increment number under the cursor.
ctrl-x to decrement number under the cursor.
/search_string{CR} to search for search_string
?search_string{CR} to search backwards (up in file) for search_string
/\
n to find next occurrence of search_word
N to find previous occurrence of search_word
. to repeat last command action.
Terminate session:
Use command: ZZSave changes and quit.
Use command line: ":wq"Save (write) changes and quit.
Use command line: ":w"Save (write) changes without quitting.
Use command line: ":q!"Ignore changes and quit. No changes from last write will be saved.
Use command line: ":qa"Quit all files opened.
Interactive Commands:
Marking a line:
Any line can be "Book Marked" for a quick cursor return.
Type the letter "m" and any other letter to identify the line.
This "marked" line can be referenced by the keystroke sequence "'" and the identifying letter.Example: "mt" will mark a line by the identifier "t"."'t" will return the cursor to this line at any time.A block of text may be referred to by its marked lines. i.e.'t,'b
vi line buffers:
To capture lines into the buffer:
Single line: "yy" - yanks a single line (defined by current cursor position) into the buffer
Multiple lines: "y't" - yanks from current cursor position to the line marked "t"
Multiple lines: "3yy" - yank 3 lines. Current line and two lines below it.
Copy from buffer to editing session:
"p" - place contents of buffer after current line defined by current cursor position.
vim: Shift a block of code left or right:
Enter into visual mode by typing the letter "v" at the top (or bottom) of the block of text to be shifted.
Move the cursor to the bottom (or top) of the block of text using "j", "k" or the arrow keys.Tip: Select from the first column of the top line and the last character of the line on the bottom line.Zero ("0") will move the cursor to the first character of a line and "$" will move the cursor to the last character of the line.
Type >> to shift the block to the right.Type <<>
Note: The number of characters shifted is controlled by the "shift width" setting. i.e. 4: ":set sw=4"This can be placed in your $HOME/.vimrc file.
VIM editor or Visual Improved Editor
This is the advanced VI editor, where we can create multiple windows with in the single editor as shown in the below picture.
Ex: - # vim file1
We can split the screen to windows by using the following functions
Press Ctrl+w and say S //for horizontal window//
Ctrl+w and say V // for vertical window//
Say ctrl+ww or ctrl+w and arrow keys to switch between the windows
In each and every window we can use normal and all the VI editor commands and functions.
VIM editor is mainly used by programmers.

