Tuesday, December 16, 2014

Diffrence Between Linux And windows


Topic
Linux
Windows
Price
The majority of Linux variants are available for free or at a much lower price than Microsoft Windows.
Microsoft Windows can run between $50.00 - $150.00 US dollars per each license copy.
User
Everyone. From home users to developers and computer enthusiasts alike
Everyone
Manufacturer
Linux kernel is developed by the community. Linus Torvalds oversees things.
Microsoft
Development and Distribution
Linux is developed by Open Source development i.e. through sharing and collaboration of code and features through forums etc and it is distributed by various vendors
Developed and distributed by Microsoft.
File system support
Ext2, Ext3, Ext4, Jfs, ReiserFS, Xfs, Btrfs, FAT, FAT32, NTFS
FAT, FAT32, NTFS, exFAT
Text mode interface
BASH (Bourne Again SHell) is the Linux default shell. It can support multiple command interpreters.
Windows uses a command shell and each version of Windows has a single command interpreter with dos-like commands, recently there is the addition of the optional PowerShell that uses more Unix-like commands
Default user interface
Gnome or KDE (Depends on distro)
Graphical (Windows Aero)
Update method
Many

Windows Update
Security
Linux is and has always been a very secure operating system. Although it still can be attacked when compared to Windows, it much more secure.
Although Microsoft has made great improvements over the years with security on their operating system, their operating system continues to be the most vulnerable to viruses and other attacks.
Support
Although it may be more difficult to find users familiar with all Linux variants, there are vast amounts of available online documentation and help, available books, and support available for Linux.
Microsoft Windows includes its own help section, has vast amount of available online documentation and help, as well as books on each of the versions of Windows.

Monday, December 15, 2014

How to check a service is running or not in Linux?




Some times we need to check the status of a service if it is running or not to cross verify something on server. Suppose you have edited your httpd.conf file and when restarting the service it just show start service is on. But when you try to get access to the web site the site is down. At that time we can use below command to check if Apache service is running or not.. 

Syntax:
Method 1: Using service command
#service servicename status
 
Example:
 
#service httpd status
clipped output of the above command
httpd (pid 7474) is running…
 
Method 2: Using init.d scripts which are located in /etc/init.d folder 

Example:
 
/etc/init.d/cron status
Clipped output of init.d script:
cron start/running, process 1253
 
Method3: Using status command to check if the service is running or not 

Example:
status atd
Output:
atd start/running, process 1245
 
To check all the services state at a time use below command
#service –status-all
 
Note: Please make a note that due to formating –status-all is shown as -status-all

What is lost+found directory in Linux




This is an important directory which is useful for recovering files which are not properly closed due to many reason such as power failure. Lost+Found is created by system at the time of Linux OS installation for each partition we create. In other words we can say the mounted folder contains this lost+found folder. This folder contains the files with no links and files to be recovered. Any file to be recovered is kept in this folder. fsck command is used to recover these files .



If  you run fsck, the filesystem check and repair command, it might find data fragments that are not referenced anywhere in the filesystem. In particular, fsck might find data that looks like a complete file but doesn't have a name on the system — an inode with no corresponding file name. This data is still using up space, but it isn't accessible by any normal means.

If you tell fsck to repair the filesystem, it will turn these almost-deleted files back into files. The thing is, the file had a name and location once, but that information is no longer available. So fsck deposits the file in a specific directory, called lost+found (after lost and found property).

Files that appear in lost+found are typically files that were already unlinked (i.e. their name had been erased) but still opened by some process (so the data wasn't erased yet) when the system halted suddenly (kernel panic or power failure). If that's all that happened, these files were slated for deletion anyway, you don't need to care about them.

Files can also appear in lost+found because the filesystem was in an inconsistent state due to a software or hardware bug. If that's the case, it's a way for you to find files that were lost but that the system repair managed to salvage. The files may or may not contain useful data, and even if they do they may be incomplete or out of date; it all depends how bad the filesystem damage was.

On many filesystems, the lost+found directory is a bit special because it preallocates a bit of space for fsck to deposit files there. (The space isn't for the file data, which fsck leaves in place; it's for the directory entries which fsck has to make up.)