Ask a Linux Query

Small course Loadable Kernel Modules in linux Kernel 2.6

Loadable Kernel Modules in linux Kernel 2.6

Learning Objectives

  • Discuss History of Loadable Kernel Modules (LKM).
  • Describe advantages of Using LKMs
  • Describe what LKMs can do.
  • Discuss LKM Utilities
  • Installing and removing
  • Loadable Kernel Modules in Kernel 2.6

Reference

History of Loadable Module
  • Loadable Kernel Modules did not exist in Linux in the beginning.
  • Loadable Kernel Modules have been around at least since Linux1.2 (1995).
  • Device drivers were always quite modular, and only small amount of work was needed to make them Loadable Kernel Module.
  • Since about 2000 everything that make sense as an LKM had the option of being LKM.

Advantages of using LKMs
  • Don’t have to rebuild Kernel Often
  • Helps you diagnose system problem
  • Saves Memory because only required modules will be loaded in the memory.
  • Faster to maintain and debug.
  • Gives same performance as Kernel built-in code.
What LKMs can Do
  • Device drivers
  • File System Drivers
  • System Calls
  • Network Drivers
  • TTY line disciplines
  • Executable interpreters
Building Kernel Modules
  • Loadable Kernel Modules are also know as Kernel Modules.
  • After building the Kernel image issue following commands: make modules Above command compiles the source code and creates module object files
  • Then issue the following commands make modules_install Above command will copy all modules over to the conventional locations
Loadable kernel Module Utilities
  • insmod Insert an LKM into the kernel.
  • rmmod Remove an LKM from the kernel.
  • depmod Determine interdependencies between LKMs.
  • lsmod List currently loaded LKMs.
  • modinfo Display contents of .modinfo section in an LKM object file.
  • modprobe Insert or remove an LKM or set of LKMs intelligently. For example, if load A before loading B, Modprobe will automatically load A when you tell it to load B.

Inserting kernel Modules
  • Basic program for inserting LKMs is insmod.
  • Try to load the modules “msdos” and “ntfs”.
  • Try following commands to load the modules msdos, the path for module may change depending on your Kernel Version:
    # cd /lib/modules/2.6.18-53el5/kernel/fs
    # insmod msdos/msdos.ko
Listing the loaded modules
  • Loaded modules may be listed by using the “lsmod” command.
  • You may also get information about modules from “/proc/modules” cat /proc/modules
  • You may also get information about “devices” and “interrupts” from “/proc/devices” and “/proc/interrupts”

Removing Modules
  • Modules may be removed by using “rmmod” command.
  • All these commands must be executed by superuser.


Using modprobe
  • Using modprobe is a better way of loading modules. Modprobe checks dependencies and also loads the modules needed to support the module being loaded.
  • Many modules such as some CDROM Drivers and Networks Drivers require certain parameters to be passed with the modules.
  • The files “/etc/modprobe.conf”, “/etc/modprobe.conf.local” and the directory “/etc/modprobe.d” contains parameters for modules that directly access the hardware. As modprobe can use information from these files it is a better method to load modules.
  • There are no standard module parameters, drivers may have their own set of parameters. To find out parameters of a driver read the documentation for that module in the directory “/usr/src/linux/documentation”.
Kmod – The Kernel Module Loader
  • Kmod automates the process of loading Kernel Module.
  • Kmod keeps on running in the background and automatically loads a kernel Module using “modprobe” whenever a desired feature is needed in the Kernel.
  • Kmod does not unload the modules if not required in feature but with Amount of RAM available this is not a big issue.
Modules in Linux kernel 2.6
  • The Linux 2.6 kernel introduces a new, unified framework for device drivers, which requires changes to custom device drivers developed to run under earlier versions of the Linux kernel.
  • The new driver model provides a framework for full and complete support for
  1. device Plug and Play
  2. power management
  3. Defines the interfaces that these subsystems can use when communicating with individual drivers.
  • The new driver framework provides a much cleaner separation of responsibilities between buses and drivers.
  • The 2.6 Linux kernel also introduces the sysfs filesystem to provide a hierarchical view of each system's device tree (and to prevent further overloading of the proc filesystem).
  • A new naming convention for loadable kernel modules, using the .ko extension (kernel object) rather than the standard .o (object) extension used in all previous stable releases of the Linux kernel.
Summary
  • Kernel loadable module reduce the size of Kernel.
  • It is easier to debug your system when using Kernel Modules.
  • New drivers can be added to system without recompiling the Kernel.
  • A set of utilities is available to manage Kernel Modules.

Overview of the linux kernel

Overview of the linux kernel

Abstract

This article discusses the basic kernel features of the linux kernel.It starts from the history of the linux kernel to basic operataing designs required for a kernel and how linux implements it in a nutshell.Then it concludes by promising future articles on different layers of the linux kernel and also an articles on Linux kernel 2.6 features,Future of Linux which will be contributed by different members of the lkg_india group.

Audience

I myself being a kernel newbie,has intended to write the article in such a fashion that it will be understood by anyone who has used the computer.It can also be read by experienced kernel developers so as to refresh their thoughts and also suggest/crticise the mistakes in the article.This article is dedicated for free for the benefit and education of all. That a person seeking knowledge should have the opportunity to find it.Thanks to every other document written with the same vein which has made this article possible.


Intoduction


To start off immediately what does kernel mean?Well thats what this blog is for,for us to understand what the kernel is.Hopefully future articles in the blog will make us understand the kernel completely and clearly.Well here is the literal meaning of the word "kernel" straight from dict.org

"The central, substantial or essential part of anything;the gist; the core;"

This is how the Online dictionary of computing defines the word kernel

"The essential part of Unix or other operating systems, responsible for resource allocation,low-level hardware interfaces, security etc"

Operating System

Any computer system includes a basic set of programs called the operating system. The most important program in the set is called the kernel.The other programs are less crucial utilities; they can provide a wide variety of interactive experiences for the user as well as doing all the jobs the user bought the computer for but the essential shape and capabilities of the system are determined by the kernel.

Is kernel the entire operating system?

No,as discussed above.The kernel is the core component of the operating system.The operating system contains the Kernel plus other systen utilities which use the kernel to provide higher level house keeping tasks.Technically speaking,Linux is only the kernel,as it does not provide system utilities like file system utilities,compilers,editors,the graphical user interface which are provided by any other operating system.So linux users typically rely on commercial ditributions like Suse,Red Hat etc., to have the entire operating system.Having known the what a Operating system and what the kernel is,let us know something about the history of the Linux kernel.

Linux,the revolutionay open source kernel

Linux was intially developed by Linus in Aug 1991.As a source of inspiration listed below is his mail on the famous comp.os.newsgroup

"----- Message from "Linus Benedict Torvalds"
on Mon, 26 Aug 1991 02:27:08 +0530 -----


Subject: What would you like to see most in minix?




Hello everybody out there using minix-


I'm doing a (free) operating system (just a hobby, won't be big
and professional like gnu) for 386(486) AT clones. This has
been brewing since april, and is starting to get ready. I'd like
any feedback on things people like/dislike in minix; as my OS
resembles it somewhat (same physical layout of the file-sytem
due to practical reasons)among other things.


I've currently ported bash (1.08) an gcc (1.40), and things seem to work.
This implies that i'll get something practical within a few months, and I'd
like to know what features most people want. Any suggestions are welcome,
but I won't promise I'll implement them :-)

Linus Torvalds torvalds@kruuna.helsinki.fi"

As seen from the mail there was an effort by the FSF(Free Software Foundation) headed by Richard Stallman to build a complete free professional Operating System. So lets talk about FSF before proceeding further.

FSF - RICHARD STALLMAN

The FSF was founded by Richard Stallman in 1984.Its also know as the GNU software project which was launched to built a complete free operating system.When richard started working for writing a free OS he felt that he should use a free editor to write programs for the Operating system,then he wrote the GNU emacs editor.Then they needed a free compiler to compile their C programs,thereby was born the GNU Compiler collection(gcc).Later when linus released Linux kernel free and it became popular,it was adopted by FSF as their kernel.So GNU utilities were used with the Linux kernel to make the complete Operating System.Now Linux remains as one of the most popular Open source operating system in the world.


Features of the Linux Kernel

I.Monolithic kernel with module support

The linux kernel is monolithic with module suport.So now let us try to decipher the meaning of the previous sentence and why linux adopted a monolithic kernel with module strategy.

Monolithic kernel
A monolithic kernel is a single large complex "do-it-yourself" kernel program which is composed of several different logical entities(kernel layers).Each kernel layer is integrated in to the large kernel program and runs in kernel mode(more on kernel mode later)on behalf of the current process.

Microkernel

A micro kernel consists of a small set of important fucntions in the kernel generally a simple scheduler,synchronisation primitives.Several System processes that run on top of the kernel to implement other OS layer functions like memory allocators,device drivers,system calls,file system etc., These kernel layers cordinate together by message passing between them.Therby because of the message passing the microkernel is slower than the monolithic kernel.

Monolithic Vs Microkernel

Monolithic Kernel is faster than microkernel as stated above.However,Microkernel has some theoritical advantages over the monolithic kernel.They are as follows,

1.The microkernel occupies less RAM,since system processes(as disscussed above) that are not doing their functionalities are swapped out or destroyed.

2.The architecture of the microkernel forces the programmers to adopt a modularized approach
as different layers of the kernel are independant of each other.Moreover,the different layers interact with each other through clear well defined software interfaces.

3.Moreover, an existing microkernel operating system can be fairly easily ported to other architectures, since all hardware dependent components are generally encapsulated in the microkernel code.


Modules,the linux way

Modules are a kernel feature that effectively achieves many of the theoretical advantages of microkernels without introducing performance penalties. A module is an object file whose code can be linked to (and unlinked from) the kernel at runtime. The object code usually consists of a set of functions that implements a filesystem, a device driver, or other features at the kernel's upper layer. The module, unlike the external layers of microkernel operating systems, does not run as a specific process. Instead, it is executed in Kernel Mode on behalf of the current process, like any other statically linked kernel function.

Advantages provided by a monolithic kernel with modules

1.Less main memory usage
A module is linked to the kernel when its functionality is needed and unlinked when its no longer used.This mechanism is done automatically by the kernel and is transparent to the user.

2.Modularized approach
Modules force the programmers to intoduce well defined software interfaces for interaction.

3.Platform independence
A module does not depend on a fixed hardware platform.A module like device driver is infact specfic to the device but not to the hardware platform(x86,sparc etc..,)

4.Faster
Since the module is linked in to the kernel,it is faster like the monolithic kernel as there is no message passing as in microkernel.Infact there is small time we lose for linking and unlinking of the modules which is less than that of the time required for message passing in microkernels.

II.Linux Filesystem

Files are a basic abstraction provided by the operating system along with processes(more about processes later).A file is an information container structured as a sequence of bytes.From the user's point of view, files are organized in a tree-structured name space starting from /(parent) which is called the root directory.

Different file types in linux

The beauty of linux lies in the fact that it almost treats everything as files including devices. There are the following types of files

1. Regular files
2. Directory files
3. Symbolic links
4. Device files(character,block).
5. Pipes
6. Sockets

The first three types are constituents of the linux filesystem.Device files are related to I/O devices and device drivers integrated into the kernel.Pipes and sockets are special files used for interprocess communication.

Inode

All information needed by the filesystem to handle a file in included in a data structure called the inode.Each file has its own inode which the filesystem uses to identify the file.The following information is kept in the inode
1.File type(as discussed above)
2.Number of hard links associated with the file(see next section)
3.File length in bytes
4.Inode number that identifies the file within the filesystem
5.User ID of the file owner(discussed below)
5.Group ID of the file(discussed below)
6.The last modify time
7.Access rights and file mode (discussed below)

Hard links and symbolic links

The same file may have several links included in the same directory or in different ones, thus several filenames.

Hardlink

A hardlink is just a different filename but points to the same inode on the disc.So the file information of the both the file and the hard link will coincide as they point to the same inode.The unix command used to create a hard link is
$ln f1 f2

f2 is the hard link for file f1

Limitations of hard link

1.Hard links cannot exist to directories as it might transform the tree structure in to a graph with cycles thus making ti impossible to locate a file according to its name.

2.Hard links can be created only for files in the same filesystem as inode is the same.This is a serious limitation as Linux supports variuos other filesystems.

Softlink



Symbolic links are short files that contain an arbitrary pathname of another file. The pathname may refer to any file located in any filesystem,it may even refer to a non exixtent file or a file in another filesystem.Thus symbolic links are short files than contain the pathname of the file that is linked to.So a symbolic link will have a separate inode for itself.The unix command to create a symbolic link is
$ln -s f1 f2

f2 is a symbolic link to f1.The linux filesystem will create a sym link f2 and will write in to it the pathname for f1.In this way f2 can refer to f1.

Users and Groups

A multiuser system is a computer that is able to concurrently and independently execute several applications belonging to two or more users. "Concurrently" means that applications can be active at the same time and contend for the various resources such as CPU, memory, hard disks, and so on. "Independently" means that each application can perform its task with no concern for what the applications of the other users are doing.

In a multiuser system, each user has a private space on the machine: typically, he owns some quota of the disk space to store files, receives private mail messages, and so on. The operating system must ensure that the private portion of a user space is visible only to its owner. In particular, it must ensure that no user can exploit a system application for the purpose of
of violating the private space of the another user.
All users are identified by a unique number called the User ID , or UID. Usually only a restricted number of persons are allowed to make use of a computer system. When one of these users starts a working session, the operating system asks for a login name and a password.If the user does not input a valid pair, the system denies access. Since the password the assumed to be private the users privacy is maintained.In order to selectively share material with other users, each user is a member of one or more groups, which are identified by a unique number called a Group ID,or GID. Each file is associated with a UID and GID.

Access rights and mode

The users of a file fall in to one of this three classes

1.The owner of the file
2.The users who belong to the same groups as that of the owner
3.All other users(others) in the system

There are three types of access rights for each of these classes namely
Read,write and execute.
Thus the set of access rights associated with a file in linux consists of nine(3(for diff classes of users) * 3(for different access rights)) different flags.There are three additional flags which define the file mode which have a meaning when applied to executable files.They are
1.SUID flag

If the executable file has the SUID flag set, the process gets the UID of the file owner.

2.SGID

If the executable file has the SUID flag set, the process gets the GID of the file group.

The suid and sgid programs are important programs to be protected in a secure system as they change the id's during execution.So an intruder might use these programs for executing something malicious on behalf of the user who is suid or sgid.

3.sticky
An executable file with the sticky flag set corresponds to a request to the kernel to keep the program in memory after its execution terminates.These flag is set when many processes share the same program for example vi might be used by many processes.So vi can have its sticky bit set.This flag has become obsolete as other approaches like copy-on-write are used now for sharing code pages between processes.

chmod is the unix command used to allow the user to set access and mode flags for a file.

Example
$chmod 4777 f1

4777 in binary is 100111111111.So there are 12 bits corresponding to User classes,access and mode permissions as below.

100---will set the suid flag for f1(mode of the file)
111---will give read,write,exec access to owner of f1
111---will give read,write,exec access to other users of the group which the user belongs to.
111---will give read,write,exec access to other remaining users in the system.


Virtual File System technology

Linux follows a object oriented Virtual File System technology inspired from SVR4 and solaris.There linux supports most of the filesystems like DOS,FAT,ext3,resierfs,JFS etc..,Also porting a file system to Linux is very easy task because of the VFS technology that linux follows.

III.Processes in Linux

Process is another fundamental abstraction(apart from File) provided by the OS.Having seen a overview of the filesystem in linux let us see how linux handles processes.

A process can be defined either as "an instance of a program in execution," or as the "execution context" of a running program. In traditional operating systems, a process executes a single sequence of instructions in an address space,the address space is the set of memory addresses that the process is allowed to reference.Operating systems like linux allow multiple execution flows,that is,multiple sequences of instructions executed in the same address space.

Multiuser systems must allow different processes to be active concurrently and thereby contend for tbe resources,mainly the CPU.Such systems are said to be multitasking systems.The scheduler is the part of the kernel which decided which process will run on the CPU at a given instant of time.It is done in such a manner that every process feels that it is the only process running on the CPU.This concept is called virtualization of the processor.Another virtualisation that is provided by linux(or any OS) to processes is the virtual memory where in a process feels that it has the entire memory on system available to it.Processes of a multiuser system must be preemptive ie., the scheduler of the kernel will decide how long each process can hold the CPU.Thereby if a higher priority process comes in to execution the scheduler will preempt the lower priority running process.

Linux is a multiprocessing system with preemptive processes.

Process management in Linux

The fork( ) and exit( ) system calls are used respectively to create a new process and to terminate it.Linux maintains a clear distinction between the process and the program by using exec( )-like system call to load a new program.After exec has been done the process resumes execution with a brand new address space containing the loaded program.

Process Creation
Processes in Linux follow a parent child relationship.The Process which invokes the fork is the parent and the process that is created is the child.The init process(created by the init.c of the kernel) is the root parent of all the other processes in linux.The task_struct is the data structure in the kernel that defines the process.Parents and children can easily find each other as the data structure contains information about the relationship.Linux implements fork using the copy-on-write approach which defers address space duplication of parent to the child on fork.The address space is copied only when a write is being made in to the address space.So till a write happens the parent and the child share only the Page tables and not the address space.The copy-on-write has the following advantage

1.Most instances of fork are followed by an exec to a program as the child does some other functionailty when compared to the program.Thereby it is a waste(an overhead) to copy the address space of the parent to the child and then again immediately overwrite the address space.So this overhead is reduced by the copy-on-write approach.

Process Termination
The exit system call is used to terminate a process.The kernel handles this system call by releasing the resources owned by the process and sending the parent process a SIGCHLD signal, which is ignored by default.

Zombie processes
The parent enquires about the termination of the child process by the wait( ) system call which allows a process to wait until one of its children terminates; it returns the process ID (PID) of the terminated child.A special zombie process state is introduced to represent terminated processes on which the parent has not issued a wait system call.The process descriptor of the child is released after the wait is executed by the parent and the child process goes to the stopped state.Now the question arises if the parent does not issue a wait call and if it terminates what happens to the child in Zombie state.There will be many zombies which will occupy useful memory.The solution lies in init process which takes over as the parent of child process whose parents have terminated.It routinely issues wait calls thereby getting rid of the zombies.

IV.The process/Kernel model

Having known about the kernel architecture and the basic abstractions(file,process) let us now see how the linux kernel is modelled.On multiuser/multitasking systems the operating system must hide all low level details concerning the physical organization of the computer from applications run by user.So when a user application wants to access a hardware,it request the kernel which evaluates the request and if it chooses to grant access,it interacts with the hardware on behalf of the process.This thereby enhances the security on multiuser systems which prevent user applications from damaging the system hardware resources.Probably,this is the reason why DOS does not require such a model as it is single user system which allows the user to do anything with the systems hardware.

Well how does linux implement the above mentioned feature.All modern operating systems,implement the above mentioned feature with the help of hardware specific features which forbids the user programs to interact directly with the hardware.For example,the x86 CPU provides four rings of execution from ring 0 to ring 3 in the order of descending privileges.Linux uses the two rings namely ring 0 and ring 3 for implementing the feature.User mode applications run in ring 3 of x86 and kernel runs in ring 0 of x86.Therefore these rings correspond to the User mode and kernel mode concept of the linux operating system.

Note:Intel introduced protected mode(ring levels) starting from 80386.So Linux was developed for 80386 and above(commonly referred as i386/i686 architectures).

When a program is executed in User Mode, it cannot directly access the kernel data structures or the kernel programs. When an application executes in Kernel Mode, however, these restrictions no longer apply. Each CPU model provides special instructions to switch from User Mode to Kernel Mode and vice versa. A program executes most of the time in User Mode and switches to Kernel Mode only when requesting a service provided by the kernel. When the kernel has satisfied the program's request, it puts the program back in User Mode.

The kernel is a process manager and not a process by itself.The creation,deletion and handling of processes are done by a group of routines in the kernel.The process/kernel model in linux allows a process to request a kernel service through system calls.System calls thereby take the process from user mode to kernel mode,does the necessary request and puts the process back in the user mode.

A switch to Kernel mode from user mode will happen by any one of these methods

1.Through system call by a process as discussed above
2.The CPU exceutes an exception.The exception has to be handled by the kernel on behalf of the process that caused the exception.For example,the kernel must handle the page fault exception.
3.A device issues an interrupt to the CPU to notify the CPU an event.In this case the kernel executes the corresponding interrupt handler for the device.

Linux also has some privileged kernel level processes.They are called kernel threads.Linux uses kernel threads in a limited way for certain functionalites.They execute in the kernel thread.keventd is an example of a kernel thread.

V.Kernel Synchronisation

On multiuser/multitasking systems many processes must be handled by the kernel at a single instant of time as several processes may be executing in the kernel at the same time.For example ,a process executing on a CPU in a uniprocessor system might be waiting on some I/0.During this time the process in kernel mode is interleaved and another process is executed in the kernel.When the I/O interrupt is finished the process waiting for I/O is executed again.So the Linux kernel must be reentrant,ie..,multiple processes must be handled by the kernel maintaining the global data structures they use in a consistent state.
Before proceeding further,we will see the definition of a kernel control path.A kernel control path is a sequence of instructions executed in the kernel mode on behalf of a process or on behalf of an interupt.

How can Kernel reentrancy be achieved?

The following are the methods to achieve kernel reentrancy

1.Reentrant functions
2.Atomic operations
3.Non Premptive kernel
4.Interrupt disabling
5.Locking mechanisms(semaphores and spinlocks)

Reentrant functions
Reentrant functions are those functions which operate only on local variable and not on global data structures.But the kernel cannot only be limited to reentrant functions.Also the kernel has a fixed stack which is small,so local variable must be less.

Before looking at other mechanisms of achieving reentarncy let us see what a race condition is and what is a critical region.

Assume that there is a global data structure(a resource) R1.If R1 is one the resource is free.Now a kernel control path KCP1 reads the value of R1 which is 1 i.e.., the resource is free.Now if KCP1 is interleaved from the kernel and if KCP2 reads the value of R1 which is still 1.It will take the resource and decrement the value to 0.Now if KCP1 resumes execution it still sees that the resource is free and decrements the value of R1 to -1,thereby taking the resource.So both the KCP's are using the resources leading to dangerous effects.This is a race condition.

Atomic operations
It is always safe to access a global variable with a single atomic uninteruptible instruction.For example in the previuos example if the two kernel paths have read the data and decremented the value of R1 in a singl operation there would have been no race condition.

But its always not possible to access data structures in a single atomic operation.Any section of code that should be finished by a process befored another process is scheduled is called the critical region.Further mechanisms we will see how to protect critical regions.

Non Premptive kernel
A simple solution to synchronisation problems is to make the kernel non preemptive ie., when a process is in kernel mode it cannot be interleaved by any other process until it voluntarily relinquishes the CPU(in which case it makes sure that the Data structures are in a consistent state).Therefore in a non preemptive kernel all the global data structures except those that are used by interupts and exceptions are safe(as interleaving of a process in kernel mode happens when a interuppt or exception occurs).Non premptability is ineffective in Multiprocessor systems as two kernel control paths executing in different CPU's can access the same data structure.The linux kernel was non preemptable until 2.5 devt series and 2.6 stable series.Now the kernel is preemptible.Preemptible kernels are more suited for time critical real time processes.


Interrupt disabling
Another method to achieve synchronisation is to disable interuppts before entering a critical region and enabling it after the critical region.This is a simple solution but is not optimal as large critical region will have the Hardware interrupts freezed for a long time leading to a freeze.Also it is ineffective in multiprocessor systems as the data structure might be accessed by another process running in a different CPU.

Locking mechanisms
The locking mechanisms lock the corresponding global data structure in question thereby making sure that when the lock is acquired only a single process can access the data structure.They are effective both in Uniprocessor and Multiprocessor systems.The locking mechanisms used by the linux kernel are

1.Semaphores
2.Spin Locks

Semaphores
A semaphore is simply a counter associated with a data structure; the semaphore is checked by all kernel threads before they try to access the data structure.Each semaphore may be viewed as an object composed of:

a)An integer variable
b)A list of waiting processes
c)Two atomic methods: down() and up()

The down() method decrements the value of the semaphore. If the new value is less than 0, the method adds the running process to the semaphore list and then blocks (i.e., invokes the scheduler). The up() method increments the value of the semaphore and, if its new value is greater than or equal to 0, reactivates one or more processes in the semaphore list. Each data structure to be protected has its own semaphore, which is initialized to 1. When a kernel control path wishes to access the data structure, it executes the down() method on the proper semaphore. If the value of the new semaphore isn't negative, access to the data structure is granted. Otherwise, the process that is executing the kernel control path is added to the semaphore list and blocked. When another process executes the up() method on that semaphore, one of the processes in the semaphore list is allowed to proceed.


SpinLocks
In multiprocessor systems, semaphores are not always the best solution to the synchronization problems. Some kernel data structures should be protected from being concurrently accessed by kernel control paths that run on different CPUs. In this case, if the time required to update the data structure is short, a semaphore could be very inefficient. To check a semaphore, the kernel must insert a process in the semaphore list and then suspend it. Since both operations are relatively expensive, in the time it takes to complete them, the other kernel control path could have already released the semaphore. In these cases, multiprocessor operating systems make use of spin locks. A spin lock is very similar to a semaphore, but it has no process list: when a process finds the lock closed by another process, it "spins" around repeatedly, executing a tight instruction loop until the lock becomes open. Of course, spin locks are useless in a uniprocessor environment. When a kernel control path tries to access a locked data structure, it starts an endless loop. Therefore, the kernel control path that is updating the protected data structure would not have a chance to continue the execution and release the spin lock. The final result is that the system hangs.

Signals and interprocess communication
The linux kernel implements signals for communicating to the process an event.For example,SIGKILL is sent to the process if it receives a terminate signal.The linux kernel implements 32 different posix signals.User processes can communicate with each other with the help of SYS V IPCs like sahred memory,pipes,fifos,semaphores and message queues.

VI.Memory Management in Linux

Memory management is the most complex(as it is architecture dependant) and important activity in the kernel.Linux supports Virtual memory management.Linux uses paging to implement virtual memory concept.Linux does not use segmentation.Memory management will be described in detail in a later article.For now the advantages a virtual memory offers are

1.Several processes can be executed concurrently.
2.It is possible to run applications whose memory needs are larger than the available physical memory.
3.Processes can execute a program whose code is only partially loaded in memory.
4.Each process is allowed to access a subset of the available physical memory.
5.Processes can share a single memory image of a library or program
6.Programs can be relocatable, that is, they can be placed anywhere in physical memory.
7.Programmers can write machine-independent code, since they do not need to be concerned about physical memory organization.

RAM USAGE

The usage of memory is one very important thing that has to be taken care by the kernel.Linux clearly distiguishes between Memory that is dedicated to the kernel and the memory that can be used by the processes.The static kernel image is loaded from the 1st Megabyte of the RAM and is pinned(it is not swapped or paged out).The remaining part of the RAM is used for

1.Kernel dynamic structures
2.Memory for processes
3.Caches for disks etc., to get better performance.

How the memory is allocated for above mentioned three is very important and hence requires a separate article.In a few words, linux takes care of memory allocation problems like internal fragmentation,external fragmentation etc., by making use of buddy system algorithm and slab allocation mechanism.So Linux uses a Slab allocator on top of a buddy system algorithm.

Virtual Adddress space of a process
Every process in linux has a virtual address space(ranging from 0 to 4GB on a 32 bit intel CPU).
A address space of a process contains all the virtual memory addresses that the process can reference.The kernel usually stores a process virtual address space as a list of memory area descriptors(for example memory area descriptors to the code segment,stack segment,heap etc.,).Linux uses demand paging ie., the page is allocated after a page fault happens.


VII.Device drivers

Having discussed most of kernel subsystems namely filesystem,process,synchronisation,interrupts,syscalls,meory management lets see in a nutshell about device drivers.The kernel interacts with I/O devices with help of device drivers.Device drivers are included in the kernel and consist of data structures and functions that control one or more devices like hard disks,keyboard,mouse etc.,Each driver interacts with the remaining part of the kernel (even with other drivers) through a specific interface.There the device driver layer can be seen as the last layer in the kernel interacting with other layers through well defined interfaces.This approach helps programmers to write device specfic code in a separate module without knowing about the kernel source code as well as the internal architecture.

VIII.Linux implementation of threads

Finally,it is mandatory to discuss how linux supports multithreaded application programming as it does in a unique manner.In linux threads are also processes which share the address space of the processes.Linux implements threads as processes because the process creation time in linux is much faster compared to other OS'es.A thread is therefore a process which can scheduled independently of the main process and it shares the same address space.


SUMMARY
In summary a linux kernel is monolithic with modular support and consists of the following subsystems,
1.Filesystem
2.Process management
3.Memory management
4.Synchronisation
5.System calls
6.Device drivers
7.Interrupts and exceptions
8.Signals
The explanation and deciphering of the different kernel layers will be explained in future articles contirbuted by the various members of the lkg_india.I also promise two more articles which will be extension of this article namely
1.Linux kernel 2.6 features
2.Linux VS other Operating systems and the future of linux

A thread and A task

A thread is a point of control flow in a task. A task
exists to provide resources for the threads it contains. This split is made to provide
for parallelism and resource sharing.
A thread

* is a point of control flow in a task.
* has access to all of the elements of the containing task.
* executes (potentially) in parallel with other threads, even threads within the same task.
* has minimal state information for low overhead.

A task

* is a collection of system resources. These resources, with the exception of the address space, are referenced by ports. These resources may be shared with other tasks if rights to the ports are so distributed.
* provides a large, potentially sparse address space, referenced by virtual address.Portions of this space may be shared through inheritance or external memory management.
* contains some number of threads.

Packet Processing In iptables ..

Packet Processing In iptables ..

All packets inspected by iptables pass through a sequence of built-in tables (queues) for processing. Each of these queues is dedicated to a particular type of packet activity and is controlled by an associated packet transformation/filtering chain.

There are three tables in total. The first is the mangle table which is responsible for the alteration of quality of service bits in the TCP header. This is hardly used in a home or SOHO environment.

The second table is the filter queue which is responsible for packet filtering. It has three built-in chains in which you can place your firewall policy rules. These are the:

* Forward chain: Filters packets to servers protected by the firewall.
* Input chain: Filters packets destined for the firewall.
* Output chain: Filters packets originating from the firewall.

The third table is the nat queue which is responsible for network address translation. It has two built-in chains; these are:

* Pre-routing chain: NATs packets when the destination address of the packet needs to be changed.
* Post-routing chain: NATs packets when the source address of the packet needs to be changed

What is iptables?

What is iptables?

Originally, the most popular firewall/NAT package running on Linux was ipchains, but it had a number of shortcomings. To rectify this, the Netfilter organization decided to create a new product called iptables, giving it such improvements as:

* Better integration with the Linux kernel with the capability of loading iptables-specific kernel modules designed for improved speed and reliability.
* Stateful packet inspection. This means that the firewall keeps track of each connection passing through it and in certain cases will view the contents of data flows in an attempt to anticipate the next action of certain protocols. This is an important feature in the support of active FTP and DNS, as well as many other network services.
* Filtering packets based on a MAC address and the values of the flags in the TCP header. This is helpful in preventing attacks using malformed packets and in restricting access from locally attached servers to other networks in spite of their IP addresses.
* System logging that provides the option of adjusting the level of detail of the reporting.
* Better network address translation.
* Support for transparent integration with such Web proxy programs as Squid.
* A rate limiting feature that helps iptables block some types of denial of service (DoS) attacks.

Considered a faster and more secure alternative to ipchains, iptables has become the default firewall package installed under RedHat and Fedora Linux.

How To Start iptables?

You can start, stop, and restart iptables after booting by using the commands:

[root@bigboy tmp]# service iptables start
[root@bigboy tmp]# service iptables stop
[root@bigboy tmp]# service iptables restart

To get iptables configured to start at boot, use the chkconfig command:.

[root@bigboy tmp]# chkconfig iptables on


Determining The Status of iptables

You can determine whether iptables is running or not via the service iptables status command. Fedora Core will give a simple status message. For example

[root@bigboy tmp]# service iptables status
Firewall is stopped.
[root@bigboy tmp]#

Passwords and Permisssions

Ordinary users have two ways of protecting the data in their accounts:

1. choose a secure password
2. set permissions

Changing your password:

  1. One of the easiest method of breaking into a system is to crack a weak password. To create a secure password:
    • The password should be at least 6 characters long.
    • You should not use names or phrases that are easily obtained; do NOT use your name; do NOT use your dog's name; do NOT use your spouse's name; do NOT use your licence plate; do NOT use your birthdate ...
    • Include both CAPITAL and lowercase letters.
    • Include special characters ( ! @ # $ % ... )
    • Include digits
  2. One way to create a secure password is suggested in the passwd man page.
    • choose 2 small words ( eg: why not )
    • mix in some capitalization ( eg: whY Not )
    • join them with a special character ( eg: whY%Not )
  3. The command to change your password is: passwd

Setting permissions:

Access to files and directories is controlled by a permissions at both the file and directory levels.

  • permissions can be any combination of read, write, execute for the owner, group and world.
  • for a file:
    • without read permission, a user cannot view the contents of a file
    • without write permission, a user cannot modify the contents of the file
    • without execute permission, a user cannot execute the file.
  • for a directory:
    • without read permission, a user cannot get a directory listing
    • without write permission, a user cannot create new files
    • without execute permission, a user cannot cd to the directory, list the directory contents or save a file in the directory.
  • chmod - change permissions.
    • Read, write and execute permissions are set for three groups: the owner, the group and everyone else.
    • chmod 543 myfile would set access rights as follows:
      owner: 5 = 101 binary = read, not write, execute
      group: 4 = 100 binary = read, not write, not execute
      others: 3 = 011 binary = not read, write, execute
  • chmod - version 2
    • permissions can also be set using a text representation
      u - user or owner
      g - group
      o - others
      r - read permission
      w - write permission
      x - execute permission
    • chmod u+w file1
      adds write permission for the user
    • chmod +w file1
      adds write permission for the user, group and others
    • chmod go-x file1
      deletes execute permission for the group and others
    • chmod u=r file1
      changes the permissions for the user to be just read permission (group and other permissions are not changed)


Exercises:

  1. Try to change your password to cat. What error message did you get?
  2. Try to change your password to blackcat. What error message did you get?
  3. Think up a password and change your password.
  4. Try to the password for another user. For example, enter the command:
    passwd floopy
    What error message did you get?
  5. Can you view the contents of the directory /sbin?
  6. What are the permissions for the directory /sbin?
  7. Change the permissions on "readme" in your own home so that you have read/write access, the group has read access and others have no access.
  8. Change permissions on your home directory so that you have read/write/execute permissions, the group has read/execute permissions, and everyone else has no access.
  9. Make sure that you are in your own home directory. Create a subdirectory called ddd and copy readme to ddd/fff (a file called fff in the ddd subdirectory).
    • what are the permissions on ddd and fff? ____________________
    • change the permissions on fff to only rwx for the owner.
  10. Try the following exercise to see some of the operations that you can and cannot do when you have only read permission on a directory.
    • change the permissions on ddd only r for the owner (no permissions for the group and the world)
    • can you get a directory listing for ddd? _____
    • can you cd to ddd? _____
    • can you view the contents of fff with the command: cat ddd/fff ? ______
    • can you delete fff with the command: rm ddd/fff ?______
  11. Try the following to see what you can do when you have read and execute permission for a directory.
    • change the permissions on ddd only rx for the owner (no permissions for the group and the world)
    • can you get a directory listing for ddd? _____
    • can you cd to ddd? _____
    • can you view the contents of fff with the command: cat ddd/fff ? ______
    • can you delete fff with the command: rm ddd/fff ? ______
  12. Try the following to see what you can do when you have write and execute permissions for a directory.
    • change the permissions on ddd only wx for the owner (no permissions for the group and the world)
    • can you get a directory listing for ddd? _____
    • can you cd to ddd? _____
    • can you view the contents of fff with the command: cat ddd/fff ? ______
    • can you delete fff with the command: rm ddd/fff ? ______
    • can you execute the command: cd ; cp readme ddd/fff _____
  13. Try the following to see what you can do when you have only execute permissions for a directory.
    • change the permissions on ddd only x for the owner (no permissions for the group and the world)
    • can you get a directory listing for ddd? _____
    • can you cd to ddd? _____
    • can you view the contents of fff with the command: cat ddd/fff ? ______
    • can you delete with the command: rm ddd/fff
    • can you execute the command: cd ; cp readme ddd/fff _____


Questions and Answers:

  1. The directory entries for the /etc directory and the file /etc/passwd are:
    -rwxr-xr-x 18 root root 1024 May 20 11:58 /etc
    -rw-r--r-- 1 root root 658 May 20 11:58 /etc/passwd

    Can you modify this file (assuming you are not root)?

    Answer: No.
  2. Can you copy /etc/passwd to your own home directory assuming that you have write and execute permissions for your own home directory?

    Answer: Yes. Everyone has read permission for this file and can make a copy.
  3. If you are not floopy, can you copy /etc/passwd (permissions rw-r--r--) to the directory /home/floopy? The permissions on /home/floopy are rwxr-xr-x.

    Answer: No. /home/floopy is owned by floopy and the permissions are rwxr-xr-x meaning that everyone can read the contents of the directory but only floopy can store files in this directory.
  4. File1 has permissions: r--r--r--
    You enter the command: chmod ug+w file1
    What are the new permissions?

    Answer: rw-rw-r--
  5. What command will change the permissions on dir1 so that only the owner has read/execute access?

    Answer: chmod 500 dir1
  6. Can you cd to dir1 given the permissions are drw-------?

    Answer: No. Without execute access, you cannot cd to a directory or access any of the files in the directory.
  7. What command will change the permissions on dir1 so that you have write/execute permissions only?

    Answer: chmod 300 dir1
  8. Can you copy readme (permissions r--r--r--) to dir1 (permissions d-wx------ ) if you own dir1?

    Answer: Yes
  9. Can you get a directory listing for dir1 permissions (d-wx-wx-wx)?

    Answer: No. If you do not have read permission for a directory, then essentially you have blind access; you can write files in the dir1 but you cannot get a directory listing.

Source:http://floppix.ccai.com/protect.html

Important linux commands used in real time scenarios..

This is a linux command line reference for common operations.
Examples marked with • are valid/safe to paste without modification into a terminal, so
you may want to keep a terminal window open while reading this so you can cut & paste.
All these commands have been tested both on Fedora and Ubuntu.

CommandDescription
apropos whatisShow commands pertinent to string. See also threadsafe
man -t man | ps2pdf - > man.pdfmake a pdf of a manual page
which commandShow full path name of command
time commandSee how long a command takes
time catStart stopwatch. Ctrl-d to stop. See also sw
nice infoRun a low priority command (The "info" reader in this case)
renice 19 -p $$Make shell (script) low priority. Use for non interactive tasks
dir navigation
cd -Go to previous directory
cdGo to $HOME directory
(cd dir && command)Go to dir, execute command and return to current dir
pushd .Put current dir on stack so you can popd back to it
alias l='ls -l --color=auto'quick dir listing
ls -lrtList files by date. See also newest and find_mm_yyyy
ls /usr/bin | pr -T9 -W$COLUMNSPrint in 9 columns to width of terminal
find -name '*.[ch]' | xargs grep -E 'expr'Search 'expr' in this dir and below. See also findrepo
find -type f -print0 | xargs -r0 grep -F 'example'Search all regular files for 'example' in this dir and below
find -maxdepth 1 -type f | xargs grep -F 'example'Search all regular files for 'example' in this dir
find -maxdepth 1 -type d | while read dir; do echo $dir; echo cmd2; doneProcess each item with multiple commands (in while loop)
find -type f ! -perm -444Find files not readable by all (useful for web site)
find -type d ! -perm -111Find dirs not accessible by all (useful for web site)
locate -r 'file[^/]*\.txt'Search cached index for names. This re is like glob *file*.txt
look referenceQuickly search (sorted) dictionary for prefix
grep --color reference /usr/share/dict/wordsHighlight occurances of regular expression in dictionary
archives and compression
gpg -c fileEncrypt file
gpg file.gpgDecrypt file
tar -c dir/ | bzip2 > dir.tar.bz2Make compressed archive of dir/
bzip2 -dc dir.tar.bz2 | tar -xExtract archive (use gzip instead of bzip2 for tar.gz files)
tar -c dir/ | gzip | gpg -c | ssh user@remote 'dd of=dir.tar.gz.gpg'Make encrypted archive of dir/ on remote machine
find dir/ -name '*.txt' | tar -c --files-from=- | bzip2 > dir_txt.tar.bz2Make archive of subset of dir/ and below
find dir/ -name '*.txt' | xargs cp -a --target-directory=dir_txt/ --parentsMake copy of subset of dir/ and below
( tar -c /dir/to/copy ) | ( cd /where/to/ && tar -x -p )Copy (with permissions) copy/ dir to /where/to/ dir
( cd /dir/to/copy && tar -c . ) | ( cd /where/to/ && tar -x -p )Copy (with permissions) contents of copy/ dir to /where/to/
( tar -c /dir/to/copy ) | ssh -C user@remote 'cd /where/to/ && tar -x -p' Copy (with permissions) copy/ dir to remote:/where/to/ dir
dd bs=1M if=/dev/sda | gzip | ssh user@remote 'dd of=sda.gz'Backup harddisk to remote machine
rsync (Network efficient file copier: Use the --dry-run option for testing)
rsync -P rsync://rsync.server.com/path/to/file fileOnly get diffs. Do multiple times for troublesome downloads
rsync --bwlimit=1000 fromfile tofileLocally copy with rate limit. It's like nice for I/O
rsync -az -e ssh --delete ~/public_html/ remote.com:'~/public_html'Mirror web site (using compression and encryption)
rsync -auz -e ssh remote:/dir/ . && rsync -auz -e ssh . remote:/dir/Synchronize current directory with remote one
ssh (Secure SHell)
ssh $USER@$HOST commandRun command on $HOST as $USER (default command=shell)
ssh -f -Y $USER@$HOSTNAME xeyesRun GUI command on $HOSTNAME as $USER
scp -p -r $USER@$HOST: file dir/Copy with permissions to $USER's home directory on $HOST
ssh -g -L 8080:localhost:80 root@$HOSTForward connections to $HOSTNAME:8080 out to $HOST:80
ssh -R 1434:imap:143 root@$HOSTForward connections from $HOST:1434 in to imap:143
wget (multi purpose download tool)
(cd dir/ && wget -nd -pHEKk http://www.pixelbeat.org/cmdline.html)Store local browsable version of a page to the current dir
wget -c http://www.example.com/large.fileContinue downloading a partially downloaded file
wget -r -nd -np -l1 -A '*.jpg' http://www.example.com/dir/Download a set of files to the current directory
wget ftp://remote/file[1-9].iso/FTP supports globbing directly
wget -q -O- http://www.pixelbeat.org/timeline.html | grep 'a href' | headProcess output directly
echo 'wget url' | at 01:00Download url at 1AM to current dir
wget --limit-rate=20k urlDo a low priority download (limit to 20KB/s in this case)
wget -nv --spider --force-html -i bookmarks.htmlCheck links in a file
wget --mirror http://www.example.com/Efficiently update a local copy of a site (handy from cron)
networking (Note ifconfig, route, mii-tool, nslookup commands are obsolete)
ethtool eth0Show status of ethernet interface eth0
ethtool --change eth0 autoneg off speed 100 duplex fullManually set ethernet interface speed
iwconfig eth1Show status of wireless interface eth1
iwconfig eth1 rate 1Mb/s fixedManually set wireless interface speed
iwlist scanList wireless networks in range
ip link showList network interfaces
ip link set dev eth0 name wanRename interface eth0 to wan
ip link set dev eth0 upBring interface eth0 up (or down)
ip addr showList addresses for interfaces
ip addr add 1.2.3.4/24 brd + dev eth0Add (or del) ip and mask (255.255.255.0)
ip route showList routing table
ip route add default via 1.2.3.254Set default gateway to 1.2.3.254
tc qdisc add dev lo root handle 1:0 netem delay 20msecAdd 20ms latency to loopback device (for testing)
tc qdisc del dev lo rootRemove latency added above
host pixelbeat.orgLookup DNS ip address for name or vice versa
hostname -iLookup local ip address (equivalent to host `hostname`)
whois pixelbeat.orgLookup whois info for hostname or ip address
netstat -tuplList internet services on a system
netstat -tupList active connections to/from system
windows networking (Note samba is the package that provides all this windows specific networking support)
smbtreeFind windows machines. See also findsmb
nmblookup -A 1.2.3.4Find the windows (netbios) name associated with ip address
smbclient -L windows_boxList shares on windows machine or samba server
mount -t smbfs -o fmask=666,guest //windows_box/share /mnt/shareMount a windows share
echo 'message' | smbclient -M windows_boxSend popup to windows machine (off by default in XP sp2)
text manipulation (Note sed uses stdin and stdout. Newer versions support inplace editing with the -i option)
sed 's/string1/string2/g'Replace string1 with string2
sed 's/\(.*\)1/\12/g'Modify anystring1 to anystring2
sed '/ *#/d; /^ *$/d'Remove comments and blank lines
sed ':a; /\\$/N; s/\\\n//; ta'Concatenate lines with trailing \
sed 's/[ \t]*$//'Remove trailing spaces from lines
sed 's/\([`"$\]\)/\\\1/g'Escape shell metacharacters active within double quotes
seq 10 | sed "s/^/ /; s/ *\(.\{7,\}\)/\1/"Right align numbers
sed -n '1000p;1000q'Print 1000th line
sed -n '10,20p;20q'Print lines 10 to 20
sed -n 's/.*\(.*\)<\/title>.*/\1/ip;<acronym title="quit after match">T;q</acronym>'</td><td>Extract title from HTML web page</td></tr> <tr><td> </td><td class="nw">sed -i 42d ~/.ssh/known_hosts</td><td>Delete a particular line</td></tr> <tr><td> </td><td class="nw">sort -t. -k1,1n -k2,2n -k3,3n -k4,4n</td><td>Sort IPV4 ip addresses</td></tr> <tr><td>•</td><td class="nw">echo 'Test' | tr '[:lower:]' '[:upper:]'</td><td>Case conversion</td></tr> <tr><td>•</td><td class="nw">tr -dc '[:print:]' < /dev/urandom</td><td>Filter non printable characters</td></tr> <tr><td>•</td><td class="nw">history | wc -l</td><td>Count lines</td></tr> <tr id="sets" class="pbtitle"><td colspan="3"><b>set operations</b> (Note you can <a href="http://www.pixelbeat.org/docs/env.html">export LANG=C</a> for speed. Also these assume no duplicate lines within a file)</td></tr> <tr><td> </td><td class="nw">sort file1 file2 | uniq</td><td><acronym title="Items in either file1 or file2">Union</acronym> of unsorted files</td></tr> <tr><td> </td><td class="nw">sort file1 file2 | uniq -d</td><td><acronym title="Items both in file1 and file2">Intersection</acronym> of unsorted files</td></tr> <tr><td> </td><td class="nw">sort file1 file1 file2 | uniq -u</td><td><acronym title="Items in file2 not in file1">Difference</acronym> of unsorted files</td></tr> <tr><td> </td><td class="nw">sort file1 file2 | uniq -u</td><td><acronym title="Items in only one file">Symmetric Difference</acronym> of unsorted files</td></tr> <tr><td> </td><td class="nw">join <acronym title="process whole line (assuming no NUL characters present)">-t'\0'</acronym> -a1 -a2 file1 file2</td><td>Union of sorted files</td></tr> <tr><td> </td><td class="nw">join -t'\0' file1 file2</td><td>Intersection of sorted files</td></tr> <tr><td> </td><td class="nw">join -t'\0' -v2 file1 file2</td><td>Difference of sorted files</td></tr> <tr><td> </td><td class="nw">join -t'\0' -v1 -v2 file1 file2</td><td>Symmetric Difference of sorted files</td></tr> <tr id="math" class="pbtitle"><td colspan="3"><b>math</b></td></tr> <tr><td>•</td><td class="nw">echo '(1 + sqrt(5))/2' | bc -l</td><td>Quick math (Calculate φ). See also <a href="http://www.pixelbeat.org/scripts/bc">bc</a></td></tr> <tr><td>•</td><td class="nw">echo 'pad=20; min=64; (100*10^6)/((pad+min)*8)' | bc</td><td>More complex (int) e.g. This shows max FastE packet rate</td></tr> <tr><td>•</td><td class="nw">echo 'pad=20; min=64; print (100E6)/((pad+min)*8)' | python</td><td>Python handles scientific notation</td></tr> <tr><td>•</td><td class="nw">echo 'pad=20; plot [64:1518] (100*10**6)/((pad+x)*8)' | gnuplot -persist</td><td>Plot FastE packet rate vs packet size</td></tr> <tr><td>•</td><td class="nw">echo 'obase=16; ibase=10; 64206' | bc</td><td>Base conversion (decimal to hexadecimal)</td></tr> <tr><td>•</td><td class="nw">echo $((0x2dec))</td><td>Base conversion (hex to dec) ((shell arithmetic expansion))</td></tr> <tr><td>•</td><td class="nw">units -t '100m/<a href="http://www.pixelbeat.org/misc/usain_bolt/">9.58s</a>' 'miles/hour'</td><td>Unit conversion (metric to imperial)</td></tr> <tr><td>•</td><td class="nw">units -t '500GB' 'GiB'</td><td>Unit conversion (<acronym title="powers of 10">SI</acronym> to <acronym title="powers of 2">IEC</acronym> prefixes)</td></tr> <tr><td>•</td><td class="nw">units -t '1 googol'</td><td>Definition lookup</td></tr> <tr><td>•</td><td class="nw">seq 100 | (tr '\n' +; echo 0) | bc</td><td>Add a column of numbers. See also <a href="http://www.pixelbeat.org/scripts/add">add</a> and <a href="http://www.pixelbeat.org/scripts/funcpy">funcpy</a></td></tr> <tr id="dates" class="pbtitle"><td colspan="3"><b>calendar</b></td></tr> <tr><td>•</td><td class="nw">cal -3</td><td>Display a calendar</td></tr> <tr><td>•</td><td class="nw">cal 9 1752</td><td>Display a calendar for a particular month year</td></tr> <tr><td>•</td><td class="nw">date -d fri</td><td>What date is it this friday. See also <a href="http://www.pixelbeat.org/scripts/day">day</a></td></tr> <tr><td>•</td><td class="nw">[ $(date -d "tomorrow" +%d) = "01" ] || exit</td><td>exit a script unless it's the last day of the month</td></tr> <tr><td>•</td><td class="nw">date --date='25 Dec' +%A</td><td>What day does xmas fall on, this year</td></tr> <tr><td>•</td><td class="nw">date --date='@2147483647'</td><td>Convert seconds since the epoch (1970-01-01 UTC) to date</td></tr> <tr><td>•</td><td class="nw">TZ=':America/Los_Angeles' date</td><td>What time is it on West coast of US (use tzselect to find TZ)</td></tr> <tr><td> </td><td class="nw">echo "mail -s 'get the train' P@draigBrady.com < /dev/null" | at 17:45</td><td>Email reminder</td></tr> <tr><td>•</td><td class="nw">echo "DISPLAY=$DISPLAY xmessage cooker" | at "NOW + 30 minutes"</td><td>Popup reminder</td></tr> <tr id="locale" class="pbtitle"><td colspan="3"><b>locales</b></td></tr> <tr><td>•</td><td class="nw">printf "%'d\n" 1234</td><td>Print number with thousands grouping appropriate to locale</td></tr> <tr><td>•</td><td class="nw">BLOCK_SIZE=\'1 ls -l</td><td>get ls to do thousands grouping appropriate to locale</td></tr> <tr><td>•</td><td class="nw">echo "I live in `locale territory`"</td><td>Extract info from locale database</td></tr> <tr><td>•</td><td class="nw">LANG=en_IE.utf8 locale int_prefix</td><td>Lookup locale info for specific country. See also <a href="http://www.pixelbeat.org/scripts/ccodes">ccodes</a></td></tr> <tr><td>•</td><td class="nw">locale | cut -d= -f1 | xargs locale -kc | less</td><td>List fields available in locale database</td></tr> <tr id="recode" class="pbtitle"><td colspan="3"><b>recode</b> (Obsoletes iconv, dos2unix, unix2dos)</td></tr> <tr><td>•</td><td class="nw">recode -l | less</td><td>Show available conversions (aliases on each line)</td></tr> <tr><td> </td><td class="nw">recode windows-1252.. file_to_change.txt</td><td>Windows "ansi" to local charset (auto does CRLF conversion)</td></tr> <tr><td> </td><td class="nw">recode utf-8/CRLF.. file_to_change.txt</td><td>Windows utf8 to local charset</td></tr> <tr><td> </td><td class="nw">recode iso-8859-15..utf8 file_to_change.txt</td><td>Latin9 (western europe) to utf8</td></tr> <tr><td> </td><td class="nw">recode ../b64 <> file.b64</td><td>Base64 encode</td></tr> <tr><td> </td><td class="nw">recode /qp.. <> file.qp</td><td>Quoted printable decode</td></tr> <tr><td> </td><td class="nw">recode ..HTML <> file.html</td><td>Text to HTML</td></tr> <tr><td>•</td><td class="nw">recode -lf windows-1252 | grep euro</td><td>Lookup <a href="http://www.pixelbeat.org/docs/utf8.html">table of characters</a></td></tr> <tr><td>•</td><td class="nw">echo -n 0x80 | recode latin-9/x1..dump</td><td>Show what a code represents in latin-9 charmap</td></tr> <tr><td>•</td><td class="nw">echo -n 0x20AC | recode ucs-2/x2..latin-9/x</td><td>Show latin-9 encoding</td></tr> <tr><td>•</td><td class="nw">echo -n 0x20AC | recode ucs-2/x2..utf-8/x</td><td>Show utf-8 encoding</td></tr> <tr id="CDs" class="pbtitle"><td colspan="3"><b><acronym title="Compact Disks">CDs</acronym></b></td></tr> <tr><td> </td><td class="nw">gzip < /dev/cdrom > cdrom.iso.gz</td><td>Save copy of data cdrom</td></tr> <tr><td> </td><td class="nw">mkisofs -V LABEL -r dir | gzip > cdrom.iso.gz</td><td>Create cdrom image from contents of dir</td></tr> <tr><td> </td><td class="nw">mount -o loop cdrom.iso /mnt/dir</td><td>Mount the cdrom image at /mnt/dir (read only)</td></tr> <tr><td> </td><td class="nw">cdrecord -v dev=/dev/cdrom blank=fast</td><td>Clear a CDRW</td></tr> <tr><td> </td><td class="nw">gzip -dc cdrom.iso.gz | cdrecord -v dev=/dev/cdrom -</td><td>Burn cdrom image (use dev=ATAPI -scanbus to confirm dev)</td></tr> <tr><td> </td><td class="nw">cdparanoia -B</td><td>Rip audio tracks from CD to wav files in current dir</td></tr> <tr><td> </td><td class="nw">cdrecord -v dev=/dev/cdrom -audio *.wav</td><td>Make audio CD from all wavs in current dir (see also cdrdao)</td></tr> <tr><td> </td><td class="nw">oggenc --tracknum='track' track.cdda.wav -o 'track.ogg'</td><td>Make ogg file from wav file</td></tr> <tr id="disk_space" class="pbtitle"><td colspan="3"><b>disk space</b> (See also <a href="http://www.pixelbeat.org/fslint/">FSlint</a>)</td></tr> <tr><td>•</td><td class="nw">ls -lSr</td><td>Show files by size, biggest last</td></tr> <tr><td>•</td><td class="nw">du -s * | sort -k1,1rn | head</td><td>Show top disk users in current dir. See also <a href="http://www.pixelbeat.org/scripts/dutop">dutop</a></td></tr> <tr><td>•</td><td class="nw">df -h</td><td>Show free space on mounted filesystems</td></tr> <tr><td>•</td><td class="nw">df -i</td><td>Show free inodes on mounted filesystems</td></tr> <tr><td>•</td><td class="nw"><acronym title="usually in /sbin/">fdisk</acronym> -l</td><td>Show disks partitions sizes and types (run as root)</td></tr> <tr><td>•</td><td class="nw"><a href="http://www.pixelbeat.org/docs/packaging.html">rpm</a> -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1n</td><td>List all <a href="http://www.pixelbeat.org/docs/packaging.html">packages</a> by installed size (Bytes) on rpm distros</td></tr> <tr><td>•</td><td class="nw"><a href="http://www.pixelbeat.org/docs/packaging.html">dpkg</a>-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n</td><td>List all <a href="http://www.pixelbeat.org/docs/packaging.html">packages</a> by installed size (KBytes) on deb distros</td></tr> <tr><td>•</td><td class="nw">dd bs=1 seek=2TB if=/dev/null of=ext3.test</td><td>Create a large test file (taking no space). See also <a href="http://www.pixelbeat.org/scripts/truncate">truncate</a></td></tr> <tr><td>•</td><td class="nw">> file</td><td>truncate data of file or create an empty file</td></tr> <tr id="monitor" class="pbtitle"><td colspan="3"><b>monitoring/debugging</b></td></tr> <tr><td>•</td><td class="nw">tail -f /var/log/messages</td><td><a href="http://www.pixelbeat.org/docs/web/access_log/monitoring.html">Monitor messages</a> in a log file</td></tr> <tr><td>•</td><td class="nw">strace -c ls >/dev/null</td><td>Summarise/profile system calls made by command</td></tr> <tr><td>•</td><td class="nw">strace -f -e open ls >/dev/null</td><td>List system calls made by command</td></tr> <tr><td>•</td><td class="nw">ltrace -f -e getenv ls >/dev/null</td><td>List library calls made by command</td></tr> <tr><td>•</td><td class="nw"><acronym title="usually in /usr/sbin/">lsof</acronym> -p <acronym title="process id of current shell">$$</acronym></td><td>List paths that process id has open</td></tr> <tr><td>•</td><td class="nw">lsof ~</td><td>List processes that have specified path open</td></tr> <tr><td>•</td><td class="nw">tcpdump not port 22</td><td>Show network traffic except ssh. See also <a href="http://www.pixelbeat.org/scripts/tcpdump_not_me">tcpdump_not_me</a></td></tr> <tr><td>•</td><td class="nw">ps -e -o pid,args --forest</td><td>List processes in a hierarchy</td></tr> <tr><td>•</td><td class="nw">ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'</td><td>List processes by % cpu usage</td></tr> <tr><td>•</td><td class="nw">ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS</td><td>List processes by mem usage. See also <a href="http://www.pixelbeat.org/scripts/ps_mem.py">ps_mem.py</a></td></tr> <tr><td>•</td><td class="nw">ps -C firefox-bin -L -o pid,tid,pcpu,state</td><td>List all threads for a particular process</td></tr> <tr><td>•</td><td class="nw">ps -p 1,2</td><td>List info for particular process IDs</td></tr> <tr><td>•</td><td class="nw">last reboot</td><td>Show system reboot history</td></tr> <tr><td>•</td><td class="nw">free -m</td><td>Show amount of (remaining) RAM (-m displays in MB)</td></tr> <tr><td>•</td><td class="nw">watch -n.1 'cat /proc/interrupts'</td><td>Watch changeable data continuously</td></tr> <tr id="sysinfo" class="pbtitle"><td colspan="3"><b>system information</b> (see also <a href="http://www.pixelbeat.org/scripts/sysinfo">sysinfo</a>) ('#' means root access is required)</td></tr> <tr><td>•</td><td class="nw">uname -a</td><td>Show kernel version and system architecture</td></tr> <tr><td>•</td><td class="nw">head -n1 /etc/issue</td><td>Show name and version of distribution</td></tr> <tr><td>•</td><td class="nw">cat /proc/partitions</td><td>Show all partitions registered on the system</td></tr> <tr><td>•</td><td class="nw">grep MemTotal /proc/meminfo</td><td>Show RAM total seen by the system</td></tr> <tr><td>•</td><td class="nw">grep "model name" /proc/cpuinfo</td><td>Show CPU(s) info</td></tr> <tr><td>•</td><td class="nw"><acronym title="usually in /sbin/">lspci</acronym> -tv</td><td>Show PCI info</td></tr> <tr><td>•</td><td class="nw"><acronym title="usually in /sbin/">lsusb</acronym> -tv</td><td>Show USB info</td></tr> <tr><td>•</td><td class="nw">mount | column -t</td><td>List mounted filesystems on the system (and align output)</td></tr> <tr><td>•</td><td class="nw">grep -F capacity: /proc/acpi/battery/BAT0/info</td><td>Show state of cells in laptop battery</td></tr> <tr><td>#</td><td class="nw">dmidecode -q | less</td><td>Display SMBIOS/DMI information</td></tr> <tr><td>#</td><td class="nw">smartctl -A /dev/sda | grep Power_On_Hours</td><td>How long has this disk (system) been powered on in total</td></tr> <tr><td>#</td><td class="nw">hdparm -i /dev/sda</td><td>Show info about disk sda</td></tr> <tr><td>#</td><td class="nw">hdparm -tT /dev/sda</td><td>Do a read speed test on disk sda</td></tr> <tr><td>#</td><td class="nw">badblocks -s /dev/sda</td><td>Test for unreadable blocks on disk sda</td></tr> <tr id="interactive" class="pbtitle"><td colspan="3"><b>interactive</b> (see also <a href="http://www.pixelbeat.org/lkdb/">linux keyboard shortcuts)</a></td></tr> <tr><td>•</td><td class="nw"><a href="http://www.pixelbeat.org/lkdb/readline.html">readline</a></td><td>Line editor used by bash, python, bc, gnuplot, ...</td></tr> <tr><td>•</td><td class="nw"><a href="http://www.pixelbeat.org/lkdb/screen.html">screen</a></td><td>Virtual terminals with detach capability, ...</td></tr> <tr><td>•</td><td class="nw"><a href="http://www.pixelbeat.org/lkdb/mc.html">mc</a></td><td>Powerful file manager that can browse rpm, tar, ftp, ssh, ...</td></tr> <tr><td>•</td><td class="nw"><a href="http://www.pixelbeat.org/docs/web/access_log/analyzing.html">gnuplot</a></td><td>Interactive/scriptable graphing</td></tr> <tr><td>•</td><td class="nw">links</td><td>Web browser</td></tr> <tr><td>•</td><td class="nw">xdg-open http://www.pixelbeat.org/</td><td>open a file or url with the registered desktop application</td></tr> <tr id="misc" class="pbtitle"><td colspan="3"><b>miscellaneous</b></td></tr> <tr><td>•</td><td class="nw"><a href="http://www.pixelbeat.org/settings/.bashrc">alias</a> hd='od -Ax -tx1z -v'</td><td>Handy hexdump. (usage e.g.: • hd /proc/self/cmdline | less)</td></tr> <tr><td>•</td><td class="nw"><a href="http://www.pixelbeat.org/settings/.bashrc">alias</a> realpath='readlink -f'</td><td>Canonicalize path. (usage e.g.: • realpath ~/../$USER)</td></tr> <tr><td>•</td><td class="nw">set | grep $USER</td><td>Search current <a href="http://www.pixelbeat.org/docs/env.html">environment</a></td></tr> <tr><td> </td><td class="nw">touch -c -t 0304050607 file</td><td>Set file timestamp (YYMMDDhhmm)</td></tr> <tr><td>•</td><td class="nw">python -m SimpleHTTPServer</td><td>Serve current directory tree at http://$HOSTNAME:8000/</td></tr> <!-- <tr><td align="center" colspan="3"> <div style="padding-top:5px;"> <script type="text/javascript"><!- google_ad_client = "pub-3527575214508372"; google_alternate_color = "FFFFC0"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "image"; //2006-10-04: cmdline_banner google_ad_channel ="2479280376"; google_color_border = "FFFFC0"; google_color_bg = "FFFFC0"; google_color_link = "000000"; google_color_text = "000000"; google_color_url = "000000"; //-></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </td></tr> --> </tbody> </table> <!--font-size--> <!-- google_ad_section_start(weight=ignore) --><span style="text-align: left;"> <br />source :<a href="http://www.pixelbeat.org/cmdline.html">http://www.pixelbeat.org/cmdline.html</a> <br /></span> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> </span> <span class='post-comment-link'> <a class='comment-link' href='https://querieslinux.blogspot.com/2009/08/important-linux-commands-used-in-real.html#comment-form' onclick=''> 2 comments: </a> </span> <span class='post-icons'> <span class='item-action'> <a href='https://www.blogger.com/email-post.g?blogID=2731227635114359290&postID=7274972094683794036' title='Email Post'> <img alt='' class='icon-action' height='13' src='https://resources.blogblog.com/img/icon18_email.gif' width='18'/> </a> </span> <span class='item-control blog-admin pid-2052009350'> <a href='https://www.blogger.com/post-edit.g?blogID=2731227635114359290&postID=7274972094683794036&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=7274972094683794036&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=7274972094683794036&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=7274972094683794036&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=7274972094683794036&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=7274972094683794036&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='2731227635114359290' itemprop='blogId'/> <meta content='2713319558660859282' itemprop='postId'/> <a name='2713319558660859282'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://querieslinux.blogspot.com/2009/08/kernel-modules-in-rhel.html'>Kernel Modules in RHEL</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-2713319558660859282' itemprop='description articleBody'> <a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/sysadmin-guide/ch-kernel-modules.html">http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/sysadmin-guide/ch-kernel-modules.html</a> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> </span> <span class='post-comment-link'> <a class='comment-link' href='https://querieslinux.blogspot.com/2009/08/kernel-modules-in-rhel.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-action'> <a href='https://www.blogger.com/email-post.g?blogID=2731227635114359290&postID=2713319558660859282' title='Email Post'> <img alt='' class='icon-action' height='13' src='https://resources.blogblog.com/img/icon18_email.gif' width='18'/> </a> </span> <span class='item-control blog-admin pid-1135053177'> <a href='https://www.blogger.com/post-edit.g?blogID=2731227635114359290&postID=2713319558660859282&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=2713319558660859282&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=2713319558660859282&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=2713319558660859282&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=2713319558660859282&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=2713319558660859282&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='2731227635114359290' itemprop='blogId'/> <meta content='3387788314374179728' itemprop='postId'/> <a name='3387788314374179728'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://querieslinux.blogspot.com/2009/08/special-permissions-within-red-hat.html'>special permissions within Red Hat Linux.</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-3387788314374179728' itemprop='description articleBody'> special permissions within Red Hat Linux.<br /><ul><li><i class="FIRSTTERM">setuid</i> — used only for applications, this permission indicates that the application runs as the owner of the file and not as the user executing the application. It is indicated by the character <tt class="COMPUTEROUTPUT">s</tt> in place of the <tt class="COMPUTEROUTPUT">x</tt> in the owner category. If the owner of the file does not have execution permissions, the <tt class="COMPUTEROUTPUT">S</tt> is capitalized.</li><li> <br /></li><li> <p><i class="FIRSTTERM">setgid</i> — used primarily for applications, this permission indicates that the application runs as the group owning the file and not as the group executing the application. If applied to a directory, all files a user creates within the directory are owned by the group who owns the directory, rather than by the user's private group (see the chapter titled <i class="CITETITLE">Users and Groups</i> in <i class="CITETITLE">Official Red Hat Linux Reference Guide</i> for more about user private groups). It is indicated by the character <tt class="COMPUTEROUTPUT">s</tt> in place of the <tt class="COMPUTEROUTPUT">x</tt> in the group category. If the group owner of the file or directory does not have execution permissions, the <tt class="COMPUTEROUTPUT">S</tt> is capitalized.</p> </li><li> <p><i class="FIRSTTERM">sticky bit</i> — used primarily on directories, this bit dictates that a file created in the directory can be removed only by the user who created the file. it is indicated by the character <tt class="COMPUTEROUTPUT">t</tt> in place of the <tt class="COMPUTEROUTPUT">x</tt> in the everyone category. in Red Hat Linux the sticky bit is set by default on the <tt class="FILENAME">/tmp/</tt> directory for exactly this reason.</p> </li></ul> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> </span> <span class='post-comment-link'> <a class='comment-link' href='https://querieslinux.blogspot.com/2009/08/special-permissions-within-red-hat.html#comment-form' onclick=''> 1 comment: </a> </span> <span class='post-icons'> <span class='item-action'> <a href='https://www.blogger.com/email-post.g?blogID=2731227635114359290&postID=3387788314374179728' title='Email Post'> <img alt='' class='icon-action' height='13' src='https://resources.blogblog.com/img/icon18_email.gif' width='18'/> </a> </span> <span class='item-control blog-admin pid-1135053177'> <a href='https://www.blogger.com/post-edit.g?blogID=2731227635114359290&postID=3387788314374179728&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=3387788314374179728&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=3387788314374179728&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=3387788314374179728&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=3387788314374179728&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=3387788314374179728&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='2731227635114359290' itemprop='blogId'/> <meta content='1261775498703637363' itemprop='postId'/> <a name='1261775498703637363'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://querieslinux.blogspot.com/2009/08/sticky-bit.html'>sticky bit</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-1261775498703637363' itemprop='description articleBody'> <i class="FIRSTTERM">sticky bit</i> — used primarily on directories, this bit dictates that a file created in the directory can be removed only by the user who created the file. it is indicated by the character <tt class="COMPUTEROUTPUT">t</tt> in place of the <tt class="COMPUTEROUTPUT">x</tt> in the everyone category. in Red Hat Linux the sticky bit is set by default on the <tt class="FILENAME">/tmp/</tt> directory for exactly this reason.<br /><br />source :<a href="http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/admin-primer/ch-acctsgrps.html">http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/admin-primer/ch-acctsgrps.html</a> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> </span> <span class='post-comment-link'> <a class='comment-link' href='https://querieslinux.blogspot.com/2009/08/sticky-bit.html#comment-form' onclick=''> 2 comments: </a> </span> <span class='post-icons'> <span class='item-action'> <a href='https://www.blogger.com/email-post.g?blogID=2731227635114359290&postID=1261775498703637363' title='Email Post'> <img alt='' class='icon-action' height='13' src='https://resources.blogblog.com/img/icon18_email.gif' width='18'/> </a> </span> <span class='item-control blog-admin pid-1135053177'> <a href='https://www.blogger.com/post-edit.g?blogID=2731227635114359290&postID=1261775498703637363&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=1261775498703637363&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=1261775498703637363&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=1261775498703637363&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=1261775498703637363&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=1261775498703637363&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> <div class="date-outer"> <div class="date-posts"> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='2731227635114359290' itemprop='blogId'/> <meta content='8205239143307685994' itemprop='postId'/> <a name='8205239143307685994'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://querieslinux.blogspot.com/2009/08/load-and-unload-kernel-modules.html'>Load and Unload Kernel Modules</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-8205239143307685994' itemprop='description articleBody'> Load and Unload Kernel Modules<br /><br /><p> Linux allows the Kernel to be configured at run time, to enable or disable different services as you see fit. This way you don't have to compile a monolithic kernel, and can save some memory usage. Some modules you'll only need for a short time, others you'll need all the time. You can configure your Linux machine to load kernel modules on startup so you don't have to remember to do that when (if) you reboot. </p> <h2>Module Commands</h2> <p> There are a few commands that allow you to maniuplate the kernel. Each is quickly described below, for more information say `man [command]`. </p> <ul><li><b>depmod</b> - handle dependency descriptions for loadable kernel modules.</li><li><b>insmod</b> - install loadable kernel module.</li><li><b>lsmod</b> - list loaded modules.</li><li><b>modinfo</b> - display information about a kernel module.</li><li><b>modprobe</b> - high level handling of loadable modules.</li><li><b>rmmod</b> - unload loadable modules.</li></ul> <p>The usage of the commands is demonstrated below, it is left as an excerise to the reader to fully understand the commands.</p> <h2>Using Module Commands</h2> <p>Below the different kernel module commands are demonstrated</p><p><br /></p><p> </p><pre># Show the module dependencies.<br />depmod -n<br /><br /># Install some module<br />insmod --autoclean [modnam]<br /><br /># This lists all currently loaded modules, lsmod takes no useful parameters<br />lsmod<br /><br /># Display information about module eepro100<br />modinfo --author --description --parameters eepro100<br /><br /># Removing a module (don't use the example)<br />rmmod --all --stacks ip_tables<br /></pre> <h2>Module Configuration Files</h2> <p> The kernel modules can use two different methods of automatic loading. The first method (modules.conf) is my preferred method, but you can do as you please. </p> <ul><li><b>modules.conf</b> - This method load the modules before the rest of the services, I think before your computer chooses which runlevel to use</li><li><b>rc.local</b> - Using this method loads the modules after all other services are started</li></ul> <p> Using 'modules.conf' will require you to say `man 5 modules.conf`. Using 'rc.local' requires you to place the necessary commands (see above) in the right order. </p> <h2>Sample modules.conf</h2> <pre># modules.conf - configuration file for loading kernel modules<br /># Create a module alias parport_lowlevel to parport_pc<br />alias parport_lowlevel parport_pc<br /># Alias eth0 to my eepro100 (Intel Pro 100)<br />alias eth0 eepro100<br /># Execute /sbin/modprobe ip_conntrack_ftp after loading ip_tables<br />post-install ip_tables /sbin/modprobe ip_conntrack_ftp<br /># Execute /sbin/modprobe ip_nat_ftp after loading ip_tables<br />post-install ip_tables /sbin/modprobe ip_nat_ftp<br /></pre> <h2>Sample rc.local</h2> <pre>#!/bin/sh<br />#<br /># This script will be executed *after* all the other init scripts.<br /># You can put your own initialization stuff in here if you don't<br /># want to do the full Sys V style init stuff.<br /><br />/sbin/insmod ip_tables<br />/sbin/modprobe ip_conntrack_ftp<br />/sbin/modprobe ip_nat_ftp<br /></pre> <h2>Conclusion</h2> <p> You should see/know that modules are necessary. They can be loaded via 'modules.conf' or 'rc.local', but 'modules.conf' load them first and 'rc.local' loads them last. Using the various module commands you can add, remove, list or get information about modules. </p>source: <a href="http://edoceo.com/liber">http://edoceo.com/liber</a> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> </span> <span class='post-comment-link'> <a class='comment-link' href='https://querieslinux.blogspot.com/2009/08/load-and-unload-kernel-modules.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-action'> <a href='https://www.blogger.com/email-post.g?blogID=2731227635114359290&postID=8205239143307685994' title='Email Post'> <img alt='' class='icon-action' height='13' src='https://resources.blogblog.com/img/icon18_email.gif' width='18'/> </a> </span> <span class='item-control blog-admin pid-1135053177'> <a href='https://www.blogger.com/post-edit.g?blogID=2731227635114359290&postID=8205239143307685994&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=8205239143307685994&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=8205239143307685994&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=8205239143307685994&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=8205239143307685994&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=8205239143307685994&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> <div class="date-outer"> <div class="date-posts"> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='2731227635114359290' itemprop='blogId'/> <meta content='4100589413396039601' itemprop='postId'/> <a name='4100589413396039601'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://querieslinux.blogspot.com/2009/08/what-is-difference-between-rhel4-rhel5.html'>what is the difference between RHEL4 & RHEL5?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-4100589413396039601' itemprop='description articleBody'> what is the difference between RHEL4 & RHEL5?<br /><br /> <br /><br />RHEL4 :No yum server,Selinux,secure,no cd key <br /> <br /> <br />RHEL5: yum server, advanced selinux ,more secure,virtualization<br /><br /><br />RHEL4 : Stable Kernel, Can'nt create YUM repository, <br />Selinux with 36,000 lines of code, Quite secure,no cd <br />key,no Xen. <br /> <br /> <br />RHEL5: Not stable kernel, Can create yum server, advanced <br />selinux without line of codes these are converted into <br />modules ,more secure,virtualization with Xen, As comapre to <br />RHEL 4 Many bugs in RHEL5 for e.g. Reducing LVM.,<br />IPV6 implementation.. etc<br /><br /><br />difference between RHEL 4 and RHEL 5<br />1)In RHEL 4 SELinux Block only 13 services, But on RHEL 5<br />SElinux Block 80 services<br />2) RHEL 4 have ext2 filesystem, but RHEL 5 we have ext3<br />filesystem That support Journal<br />3)RHEL 4 have no virtualization Feature, but in RHEL 5 we<br />have virtualization with Hypervisor-V <br />4)In RHEL 4 we have no Yum, But in RHEL 5 we have Yum available<br /><br /><br /> <br /><br />differnece between rhel 4 and rhel 5<br /><br /><br /> rhel4 rhel5<br />no yum server yum server<br />selinux Advanced selinux<br />secure more secure<br />no cdkey cd key<br />--- virtualization<br />mim 256 mb ram 512 ram<br />--- better support for <br /> Red Hat Directory<br /><br /><br />XEN, YUM and improved SELinux<br />all the features updated with better options<br /><br />Better GUI support then RHEL4<br />YUM over RPM package management<br /><br />IPTables and SELinux for more secure environment<br /><br /><br /> <br />Red Hat author dishes on RHEL 5<br />By Jack Loftus, News Writer<br />23 Apr 2007 | SearchEnterpriseLinux.com<br /><br />Enterprise Linux headlines<br />Digg This! StumbleUpon Toolbar StumbleUpon Bookmark with Delicious Del.icio.us Add to Google<br /><br />Tammy Fox has worn many hats in the past for Red Hat Inc., including technical writer, lead of the documents team and founding editor of Red Hat Magazine. She has also been a professional Linux writer for the past seven years. In other words, she knows Red Hat Linux.<br /><br />Five things to know about RHEL 5:<br /><br /> 1. Installation codes are necessary for installation and can unlock access to specific functionality such as virtualization and clustering.<br /> 2. Virtual machines can be created with the virtualization option, which is based on Xen.<br /> 3. Kdump can be enabled to capture dump files during system crashes.<br /> 4. YUM has replaced up2date, both the command and graphical application.<br /> 5. SELinux is enabled by default. <br /><br />- Tammy Fox, author, Red Hat Enterprise Linux 5 Unleashed<br /> <br /><br />Fox's latest work, Red Hat Enterprise Linux 5 Administration Unleashed, arrived this month intended as a tome of knowledge for intermediate to advanced Linux system administrators. Before it was published, Fox sat down with SearchEnterpriseLinux.com to provide some insight on the latest version of the Linux community's leading commercial distribution, Red Hat Enterprise Linux 5 (RHEL 5).<br /><br />What general best practices or tips can you share to make an upgrade to RHEL 5 a smooth one?<br /><br />Tammy Fox: Performing an upgrade with the installation program basically updates any existing RPM packages on your system. If the new version of the package includes changes that make your existing configuration invalid, some packages will try to migrate your existing data, but it is not required.<br /><br />The best practice is to have your data on a dedicated storage system that does not get reformatted during a fresh installation. Depending on the size of your organization, this can be a SAN, a data cluster, or just a set of dedicated hard drives in the system. Back up any existing data and configuration files, and perform a fresh installation. Restore your configuration files one by one, testing each program. Be sure to pay close attention to whether or not the software version has changed from your previous version of RHEL to RHEL 5. Finally, reconnect your data storage solution and perform any additional tests necessary.<br /><br />Of course, all of these steps should be performed on a test system before the plan is implemented on a production system.<br /><br />What are some key differences between what administrators see in RHEL 4 deployments, and RHEL 5 ones?<br /><br />Fox: The most immediate change they will notice is the introduction of installation codes. During installation, an installation code must be entered. These codes are generated by Red Hat. Depending on what services you purchased, they unlock different RHEL 5 components such as virtualization and high availability. RHEL 5 also uses new RPM GPG keys. If upgrading, you will need to install the new keys before updating packages.<br /><br />The next big noticeable change is the move to YUM for software management and maintenance. In previous versions of RHEL, the up2date command could be used to download and install software updates from Red Hat Network. It has been replaced with the YUM command, and all the up2date graphical program has been replaced with a graphical program that use YUM as well. If you schedule package updates and installation with the RHN Web site, you will not notice a difference.<br /><br />Administrators must also consider whether to use the virtualization feature in RHEL5. (Editor's Note: Due to trademark issues, Red Hat currently refers to Xen-based hypervisor technology as virtualization.) If your hardware is supported and you have systems with enough resources to share between the host system and the virtual machines, virtualization can help reduce the number of physical machines that need to be maintained. If you are a hosting service or allow your customers shell access to their Web site, virtualization can be beneficial.<br /><br />Administrators should read the release notes for a complete list of caveats and known issues with RHEL 5. For example, dual-booting with Windows Vista requires additional steps for GRUB to boot Windows Vista. <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> </span> <span class='post-comment-link'> <a class='comment-link' href='https://querieslinux.blogspot.com/2009/08/what-is-difference-between-rhel4-rhel5.html#comment-form' onclick=''> 3 comments: </a> </span> <span class='post-icons'> <span class='item-action'> <a href='https://www.blogger.com/email-post.g?blogID=2731227635114359290&postID=4100589413396039601' title='Email Post'> <img alt='' class='icon-action' height='13' src='https://resources.blogblog.com/img/icon18_email.gif' width='18'/> </a> </span> <span class='item-control blog-admin pid-1135053177'> <a href='https://www.blogger.com/post-edit.g?blogID=2731227635114359290&postID=4100589413396039601&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=4100589413396039601&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=4100589413396039601&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=4100589413396039601&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=4100589413396039601&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=2731227635114359290&postID=4100589413396039601&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> </div> <div class='blog-pager' id='blog-pager'> <span id='blog-pager-newer-link'> <a class='blog-pager-newer-link' href='https://querieslinux.blogspot.com/search?updated-max=2010-05-14T11:15:00-07:00&max-results=1&reverse-paginate=true' id='Blog1_blog-pager-newer-link' title='Newer Posts'>Newer Posts</a> </span> <span id='blog-pager-older-link'> <a class='blog-pager-older-link' href='https://querieslinux.blogspot.com/search?updated-max=2009-08-25T07:03:00-07:00&max-results=1' id='Blog1_blog-pager-older-link' title='Older Posts'>Older Posts</a> </span> <a class='home-link' href='https://querieslinux.blogspot.com/'>Home</a> </div> <div class='clear'></div> <div class='blog-feeds'> <div class='feed-links'> Subscribe to: <a class='feed-link' href='https://querieslinux.blogspot.com/feeds/posts/default' target='_blank' type='application/atom+xml'>Posts (Atom)</a> </div> </div> </div></div> </div> </div> <div class='column-left-outer'> <div class='column-left-inner'> <aside> </aside> </div> </div> <div class='column-right-outer'> <div class='column-right-inner'> <aside> <div class='sidebar section' id='sidebar-right-1'><div class='widget FeaturedPost' data-version='1' id='FeaturedPost1'> <h2 class='title'>Featured Post</h2> <div class='post-summary'> <h3><a href='https://querieslinux.blogspot.com/2015/06/what-is-linux.html'>What is Operating System ? What is Kernel ? What is Linux? </a></h3> <p> Lot of people get scared when they here they have to work on Linux, You don't have to. To drive a Car  you do not have to know how eng... </p> <img class='image' src='https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tQAOOlqfKloYRZcaHVnDgpJZv6FZSuuATedf0jzpjKKPT3YFbdwxPnDQ8P99bwZAz4PMtj72WOLu5WEgx9fydT67WrSpBTQo67jqCp7FkcF0odf4zwQYa_04Bv3u_BJ1iOPaXy=s0-d'/> </div> <style type='text/css'> .image { width: 100%; } </style> <div class='clear'></div> </div><div class='widget AdSense' data-version='1' id='AdSense1'> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client="pub-3599547134103316"; google_ad_host="pub-1556223355139109"; google_ad_width=180; google_ad_height=150; google_ad_format="180x150_as"; google_ad_type="text_image"; google_ad_host_channel="0001+S0005+L0001"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="666666"; google_color_url="992211"; google_color_text="333333"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <div class='clear'></div> </div> </div><div class='widget PopularPosts' data-version='1' id='PopularPosts1'> <h2>Popular Posts</h2> <div class='widget-content popular-posts'> <ul> <li> <div class='item-content'> <div class='item-title'><a href='https://querieslinux.blogspot.com/2009/08/important-linux-commands-used-in-real.html'>Important linux commands used in real time scenarios..</a></div> <div class='item-snippet'>This is a linux command line reference for common operations. Examples marked with • are valid/safe to paste without modification into a te...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-title'><a href='https://querieslinux.blogspot.com/2009/08/what-is-port-map-why-is-it-required.html'>What is port map why is it required ?</a></div> <div class='item-snippet'>What is port map why is it required ? Linux uses a combination of kernel-level support and continuously running daemon processes to ...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-title'><a href='https://querieslinux.blogspot.com/2009/03/linux-interview-questions-for-software.html'>Linux Interview Questions For software QA Engineers</a></div> <div class='item-snippet'>Software testing - Questions and Answers - Linix / Unix 1. Q. How do you list files in a directory? A. ls - list directory contents l...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-thumbnail'> <a href='https://querieslinux.blogspot.com/2015/06/what-is-linux.html' target='_blank'> <img alt='' border='0' src='https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tQAOOlqfKloYRZcaHVnDgpJZv6FZSuuATedf0jzpjKKPT3YFbdwxPnDQ8P99bwZAz4PMtj72WOLu5WEgx9fydT67WrSpBTQo67jqCp7FkcF0odf4zwQYa_04Bv3u_BJ1iOPaXy=w72-h72-p-k-no-nu'/> </a> </div> <div class='item-title'><a href='https://querieslinux.blogspot.com/2015/06/what-is-linux.html'>What is Operating System ? What is Kernel ? What is Linux? </a></div> <div class='item-snippet'>Lot of people get scared when they here they have to work on Linux, You don't have to. To drive a Car  you do not have to know how eng...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-title'><a href='https://querieslinux.blogspot.com/2009/08/what-is-difference-between-rhel4-rhel5.html'>what is the difference between RHEL4 & RHEL5?</a></div> <div class='item-snippet'>what is the difference between RHEL4 & RHEL5? RHEL4 :No yum server,Selinux,secure,no cd key ...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-title'><a href='https://querieslinux.blogspot.com/2009/07/what-is-difference-between-swapping-and.html'>What is the difference between Swapping and Paging?</a></div> <div class='item-snippet'>Swapping occurs when whole process is transferred to disk,while paging is when some part of process is transferred to disk while rest is sti...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-title'><a href='https://querieslinux.blogspot.com/2009/03/introduction-to-system-calls-io-system.html'>Introduction to System Calls (I/O System Calls)</a></div> <div class='item-snippet'>System Calls for I/O The way that programs talk to the operating system is via ``system calls.'' -- it is a request to the operating...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-title'><a href='https://querieslinux.blogspot.com/2009/08/what-is-difference-between-processes.html'>What is the difference between processes and threads?</a></div> <div class='item-snippet'> The memory space, where a given application is executed is called - process. A Process is the memory set aside for an application to be exe...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-title'><a href='https://querieslinux.blogspot.com/2009/08/using-ethtool.html'>Using ethtool</a></div> <div class='item-snippet'>The ethtool command is slated to be the replacement for mii-tool in the near future and tends to be supported by newer NIC cards. The comman...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-title'><a href='https://querieslinux.blogspot.com/2009/04/what-is-initrd-why-is-it-required.html'>What is initrd why is it required ?</a></div> <div class='item-snippet'> The kernel almost certainly will have been passed an initial RAM disk image (usually called "initrd") by the boot loader. This ...</div> </div> <div style='clear: both;'></div> </li> </ul> <div class='clear'></div> </div> </div><div class='widget BlogArchive' data-version='1' id='BlogArchive1'> <h2>Archive</h2> <div class='widget-content'> <div id='ArchiveList'> <div id='BlogArchive1_ArchiveList'> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2009/'> 2009 </a> <span class='post-count' dir='ltr'>(105)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2009/03/'> Mar 2009 </a> <span class='post-count' dir='ltr'>(34)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2009/04/'> Apr 2009 </a> <span class='post-count' dir='ltr'>(12)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2009/05/'> May 2009 </a> <span class='post-count' dir='ltr'>(2)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2009/07/'> Jul 2009 </a> <span class='post-count' dir='ltr'>(8)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2009/08/'> Aug 2009 </a> <span class='post-count' dir='ltr'>(48)</span> <ul class='posts'> <li><a href='https://querieslinux.blogspot.com/2009/08/what-is-difference-between-rhel4-rhel5.html'>what is the difference between RHEL4 & RHEL5?</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/load-and-unload-kernel-modules.html'>Load and Unload Kernel Modules</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/sticky-bit.html'>sticky bit</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/special-permissions-within-red-hat.html'>special permissions within Red Hat Linux.</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/kernel-modules-in-rhel.html'>Kernel Modules in RHEL</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/important-linux-commands-used-in-real.html'>Important linux commands used in real time scenari...</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/passwords-and-permisssions.html'>Passwords and Permisssions</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/what-is-iptables.html'>What is iptables?</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/packet-processing-in-iptables.html'>Packet Processing In iptables ..</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/thread-and-task.html'>A thread and A task</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/overview-of-linux-kernel.html'>Overview of the linux kernel</a></li> <li><a href='https://querieslinux.blogspot.com/2009/08/small-course-loadable-kernel-modules-in.html'>Small course Loadable Kernel Modules in linux Kern...</a></li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2009/09/'> Sep 2009 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='posts'> <li><a href='https://querieslinux.blogspot.com/2009/09/ask-linux-query.html'>Ask a Linux Query</a></li> </ul> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2010/'> 2010 </a> <span class='post-count' dir='ltr'>(8)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2010/02/'> Feb 2010 </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2010/05/'> May 2010 </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2010/06/'> Jun 2010 </a> <span class='post-count' dir='ltr'>(2)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2010/07/'> Jul 2010 </a> <span class='post-count' dir='ltr'>(3)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2010/09/'> Sep 2010 </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2012/'> 2012 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2012/04/'> Apr 2012 </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2015/'> 2015 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2015/06/'> Jun 2015 </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2019/'> 2019 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://querieslinux.blogspot.com/2019/02/'> Feb 2019 </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> </div> </div> <div class='clear'></div> </div> </div><div class='widget PageList' data-version='1' id='PageList1'> <h2>Pages</h2> <div class='widget-content'> <ul> <li> <a href='https://querieslinux.blogspot.com/'>Home</a> </li> <li> <a href='https://querieslinux.blogspot.com/p/about.html'>About</a> </li> <li> <a href='https://querieslinux.blogspot.com/p/index.html'>Index</a> </li> </ul> <div class='clear'></div> </div> </div><div class='widget Stats' data-version='1' id='Stats1'> <h2>Total Pageviews</h2> <div class='widget-content'> <div id='Stats1_content' style='display: none;'> <script src='https://www.gstatic.com/charts/loader.js' type='text/javascript'></script> <span id='Stats1_sparklinespan' style='display:inline-block; width:75px; height:30px'></span> <span class='counter-wrapper graph-counter-wrapper' id='Stats1_totalCount'> </span> <div class='clear'></div> </div> </div> </div></div> </aside> </div> </div> </div> <div style='clear: both'></div> <!-- columns --> </div> <!-- main --> </div> </div> <div class='main-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> <footer> <div class='footer-outer'> <div class='footer-cap-top cap-top'> <div class='cap-left'></div> <div class='cap-right'></div> </div> <div class='fauxborder-left footer-fauxborder-left'> <div class='fauxborder-right footer-fauxborder-right'></div> <div class='region-inner footer-inner'> <div class='foot no-items section' id='footer-1'></div> <table border='0' cellpadding='0' cellspacing='0' class='section-columns columns-3'> <tbody> <tr> <td class='first columns-cell'> <div class='foot no-items section' id='footer-2-1'></div> </td> <td class='columns-cell'> <div class='foot no-items section' id='footer-2-2'></div> </td> <td class='columns-cell'> <div class='foot no-items section' id='footer-2-3'></div> </td> </tr> </tbody> </table> <!-- outside of the include in order to lock Attribution widget --> <div class='foot section' id='footer-3' name='Footer'><div class='widget Attribution' data-version='1' id='Attribution1'> <div class='widget-content' style='text-align: center;'> Simple theme. Powered by <a href='https://www.blogger.com' target='_blank'>Blogger</a>. </div> <div class='clear'></div> </div></div> </div> </div> <div class='footer-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </footer> <!-- content --> </div> </div> <div class='content-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </div> <script type='text/javascript'> window.setTimeout(function() { document.body.className = document.body.className.replace('loading', ''); }, 10); </script> <script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/517362887-widgets.js"></script> <script type='text/javascript'> window['__wavt'] = 'AOuZoY5mzZhmJMEZVZiheuypG6LBiN4dZg:1713548888620';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d2731227635114359290','//querieslinux.blogspot.com/2009/','2731227635114359290'); _WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '2731227635114359290', 'title': 'Linux Queries', 'url': 'https://querieslinux.blogspot.com/2009/', 'canonicalUrl': 'https://querieslinux.blogspot.com/2009/', 'homepageUrl': 'https://querieslinux.blogspot.com/', 'searchUrl': 'https://querieslinux.blogspot.com/search', 'canonicalHomepageUrl': 'https://querieslinux.blogspot.com/', 'blogspotFaviconUrl': 'https://querieslinux.blogspot.com/favicon.ico', 'bloggerUrl': 'https://www.blogger.com', 'hasCustomDomain': false, 'httpsEnabled': true, 'enabledCommentProfileImages': true, 'gPlusViewType': 'FILTERED_POSTMOD', 'adultContent': false, 'analyticsAccountNumber': '', 'encoding': 'UTF-8', 'locale': 'en', 'localeUnderscoreDelimited': 'en', 'languageDirection': 'ltr', 'isPrivate': false, 'isMobile': false, 'isMobileRequest': false, 'mobileClass': '', 'isPrivateBlog': false, 'isDynamicViewsAvailable': true, 'feedLinks': '\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Linux Queries - Atom\x22 href\x3d\x22https://querieslinux.blogspot.com/feeds/posts/default\x22 /\x3e\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/rss+xml\x22 title\x3d\x22Linux Queries - RSS\x22 href\x3d\x22https://querieslinux.blogspot.com/feeds/posts/default?alt\x3drss\x22 /\x3e\n\x3clink rel\x3d\x22service.post\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Linux Queries - Atom\x22 href\x3d\x22https://www.blogger.com/feeds/2731227635114359290/posts/default\x22 /\x3e\n', 'meTag': '', 'adsenseClientId': 'ca-pub-3599547134103316', 'adsenseHostId': 'ca-host-pub-1556223355139109', 'adsenseHasAds': true, 'adsenseAutoAds': false, 'boqCommentIframeForm': true, 'loginRedirectParam': '', 'view': '', 'dynamicViewsCommentsSrc': '//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js', 'dynamicViewsScriptSrc': '//www.blogblog.com/dynamicviews/d86c8c5eadffdf93', 'plusOneApiSrc': 'https://apis.google.com/js/platform.js', 'disableGComments': true, 'interstitialAccepted': false, 'sharing': {'platforms': [{'name': 'Get link', 'key': 'link', 'shareMessage': 'Get link', 'target': ''}, {'name': 'Facebook', 'key': 'facebook', 'shareMessage': 'Share to Facebook', 'target': 'facebook'}, {'name': 'BlogThis!', 'key': 'blogThis', 'shareMessage': 'BlogThis!', 'target': 'blog'}, {'name': 'Twitter', 'key': 'twitter', 'shareMessage': 'Share to Twitter', 'target': 'twitter'}, {'name': 'Pinterest', 'key': 'pinterest', 'shareMessage': 'Share to Pinterest', 'target': 'pinterest'}, {'name': 'Email', 'key': 'email', 'shareMessage': 'Email', 'target': 'email'}], 'disableGooglePlus': true, 'googlePlusShareButtonWidth': 0, 'googlePlusBootstrap': '\x3cscript type\x3d\x22text/javascript\x22\x3ewindow.___gcfg \x3d {\x27lang\x27: \x27en\x27};\x3c/script\x3e'}, 'hasCustomJumpLinkMessage': false, 'jumpLinkMessage': 'Read more', 'pageType': 'archive', 'pageName': '2009', 'pageTitle': 'Linux Queries: 2009', 'metaDescription': ''}}, {'name': 'features', 'data': {}}, {'name': 'messages', 'data': {'edit': 'Edit', 'linkCopiedToClipboard': 'Link copied to clipboard!', 'ok': 'Ok', 'postLink': 'Post Link'}}, {'name': 'template', 'data': {'name': 'Simple', 'localizedName': 'Simple', 'isResponsive': false, 'isAlternateRendering': false, 'isCustom': false, 'variant': 'simplysimple', 'variantId': 'simplysimple'}}, {'name': 'view', 'data': {'classic': {'name': 'classic', 'url': '?view\x3dclassic'}, 'flipcard': {'name': 'flipcard', 'url': '?view\x3dflipcard'}, 'magazine': {'name': 'magazine', 'url': '?view\x3dmagazine'}, 'mosaic': {'name': 'mosaic', 'url': '?view\x3dmosaic'}, 'sidebar': {'name': 'sidebar', 'url': '?view\x3dsidebar'}, 'snapshot': {'name': 'snapshot', 'url': '?view\x3dsnapshot'}, 'timeslide': {'name': 'timeslide', 'url': '?view\x3dtimeslide'}, 'isMobile': false, 'title': 'Linux Queries', 'description': '', 'url': 'https://querieslinux.blogspot.com/2009/', 'type': 'feed', 'isSingleItem': false, 'isMultipleItems': true, 'isError': false, 'isPage': false, 'isPost': false, 'isHomepage': false, 'isArchive': true, 'isLabelSearch': false, 'archive': {'year': 2009, 'rangeMessage': 'Showing posts from 2009'}}}]); _WidgetManager._RegisterWidget('_NavbarView', new _WidgetInfo('Navbar1', 'navbar', document.getElementById('Navbar1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HeaderView', new _WidgetInfo('Header1', 'header', document.getElementById('Header1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogView', new _WidgetInfo('Blog1', 'main', document.getElementById('Blog1'), {'cmtInteractionsEnabled': false, 'lightboxEnabled': true, 'lightboxModuleUrl': 'https://www.blogger.com/static/v1/jsbin/3538472454-lbx.js', 'lightboxCssUrl': 'https://www.blogger.com/static/v1/v-css/13464135-lightbox_bundle.css'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_FeaturedPostView', new _WidgetInfo('FeaturedPost1', 'sidebar-right-1', document.getElementById('FeaturedPost1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense1', 'sidebar-right-1', document.getElementById('AdSense1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_PopularPostsView', new _WidgetInfo('PopularPosts1', 'sidebar-right-1', document.getElementById('PopularPosts1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogArchiveView', new _WidgetInfo('BlogArchive1', 'sidebar-right-1', document.getElementById('BlogArchive1'), {'languageDirection': 'ltr', 'loadingMessage': 'Loading\x26hellip;'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_PageListView', new _WidgetInfo('PageList1', 'sidebar-right-1', document.getElementById('PageList1'), {'title': 'Pages', 'links': [{'isCurrentPage': false, 'href': 'https://querieslinux.blogspot.com/', 'title': 'Home'}, {'isCurrentPage': false, 'href': 'https://querieslinux.blogspot.com/p/about.html', 'id': '309987962297592491', 'title': 'About'}, {'isCurrentPage': false, 'href': 'https://querieslinux.blogspot.com/p/index.html', 'id': '1353635328029138866', 'title': 'Index'}], 'mobile': false, 'showPlaceholder': true, 'hasCurrentPage': false}, 'displayModeFull')); _WidgetManager._RegisterWidget('_StatsView', new _WidgetInfo('Stats1', 'sidebar-right-1', document.getElementById('Stats1'), {'title': 'Total Pageviews', 'showGraphicalCounter': true, 'showAnimatedCounter': false, 'showSparkline': true, 'statsUrl': '//querieslinux.blogspot.com/b/stats?style\x3dBLACK_TRANSPARENT\x26timeRange\x3dALL_TIME\x26token\x3dAPq4FmDSltoYv8bCi4_ivVxnoOWeRf6zvLsuZFe2zOnOf2v7--f6L9uWw-68Lo-ZGDSfj2R0mKB-8JASOeOX7Wgf-G_xCHpIcQ'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AttributionView', new _WidgetInfo('Attribution1', 'footer-3', document.getElementById('Attribution1'), {}, 'displayModeFull')); </script> </body> </html>