Monday 22 August 2011

Directories present in Linux Operating system


1.     Bin: provides binary libraries ie. All the library files required for execution of a program. It also creates links for the various programs which are installed in the system.

2.       Boot: this directory contains the various boot related files for eg the the configurations of boot loaders like(GRUB and lilo),kernel files(that form the core of linux).

3.       Cdrom:this is a directory in which the cd rom is mounted.

4.       Dev: this directory contains the basic configuration files for devices and their respective drivers which are used when various devices are called by the system programs.

5.       etc : This is the most important directory in the linux file system hierarchy. It consist of all the files required for for a software to run ie all the source files whjch are required during execution are present here. It consist of all the system related configuration files like login information, os informations , etc.

6.       Home: this the user directory where all user personalised files are stored by default.

7.       Lib: this consist of all the library files which are used during system calls by kernel. This also consist of kernel and other system call programs that may be required by the operating system.

8.       Mnt: It is the default directory where all the removable and non removable media including extra cd roms are mounted.

9.       Opt: Opt is reserved for additional software you install; although, most providers don’t use it. This is kind of like ‘Program Files‘ for linux.

10.   proc :Proc is a special virtual directory like /dev that contains process information. It contains runtime system info like: system memory, devices mounted, hardware configuration, etc.

11.         srv:  Srv is a serve folder. It holds site specific data to be served by the system for protocols such as, ftp, rsync, www, cvs etc. To be compliant distributions include this folder but I have not seen it used much.

12.   sbin: Sbin is similar to /bin with the exception that these ready to run binaries are reserved for root users. That is they typically will only work when executed by root or sudo. Examples would include:
·         mke2fs
·         ifconfig
·         fdisk
 tmp: Tmp is a temporary storage folder. Anything that is to be temporarily stored goes here. It is recommended that you don’t delete these manually. If you want to delete them you usually add this to boot up or shutdown procedure since they can contain useful information for programs that are already running.

14.   Usr: Usr houses all the binaries, documentation, libraries, and header files for all the user applications. Most user binaries will be installed into this folder making this one of the largest folders in the Linux directory.
15.   Var This stands for variable. This stores all the files that vary as the system runs. Things like log files, backups, mail, cache, etc..

Run Levels in Linux Operating system


Linux utilizes what is called "runlevels". A runlevel is a software configuration of the system that allows only a selected group of processes to exist. Init can run the system in one of eight runlevels. These runlevels are 0-6 and S or s. The system runs in only one of these runlevels at a time. Typically these runlevels are used for different purposes. Runlevels 0, 1, and 6 are reserved. For Redhat Linux version 6, the runlevels are:








0
-
halt
1
-
Single user mode
2
-
Multiuser, without NFS (The same as 3, if you don't have networking)
3
-
Full multiuser mode
4
-
unused
5
-
X11
6
-
Reboot

1.      level 0 : to halt the system, it reboots the systems again and again after login in
2.      level1 :single user mode, this is a special mode in which only one use ie the super user mode in which limited system based linux commands work.
3.      level2-level5 : this is the multi user mode in which the system works at its full potential with all the command set that it supports
4.      level 6 : entering into this level reboots the system.

Wednesday 17 August 2011

How to change root password with out login in

This could be easily done using single user mode of linux.

1.To boot into single user mode change any entry of grub that boots ubuntu
2. Go to the kernel line and add single at the end of it.
3. Now boot from it.
4. Once it boots to change root password
Passwd root
5. Change password and enjoy