• VMware

    Learn about VMware virtualization for its products like vsphere, vCenter Server, VMware View, VMware P2V and many more

  • Linux Tutorials

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • Monday, April 14, 2014

    How to find/view all the members of a group in Linux

    Now in Linux we have two types of groups
    • Primary Group
    • Secondary Group

    View all the members of the primary group

    First you need to know the GID of the group of whoose members you want to query for

    Syntax:
    # grep "group_name" /etc/group
    # grep dba /etc/group
    dba:x:503:

    Now grep that GID to get list of users under dba group
    # grep 503 /etc/passwd
    deepak:x:501:
    503::/home/deepak:/bin/bash
    user:x:502:503::/home/user:/bin/bash
    deep:x:503:503::/home/deep:/bin/bash

    View all the members of the secondary group

    To do this we have a no. of methods

    Method 1
    # getent group dba
    dba:x:503:deepak,deep,user,user1

    Method 2
    # grep dba /etc/group
    dba:x:503:deepak,deep,user,user1

    Method 3
    Syntax
    # groupmems -g "group_name" -l
    # groupmems -g dba -l
    deepak  deep  user  user1


    Related Articles
    How to create password less ssh connection for multiple non-root users
    How to create user without useradd command in Linux
    How to give normal user root privileges using sudo in Linux/Unix
    How to give permission to user to run some commands in Linux


    Follow the below links for more tutorials

    What is the difference/comparison between Unix and Linux ?
    What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
    RAID levels 0, 1, 2, 3, 4, 5, 6, 0+1, 1+0 features explained in detail

    Sunday, April 13, 2014

    10 practical examples to use USERADD command in linux

    Q: How do you know what default values would be assigned to a user when created using useradd command?

    A: These are the two files which contain the default values to be assigned to a user when created using useradd
    # less /etc/default/useradd
    GROUP=100
    HOME=/home
    INACTIVE=-1
    EXPIRE=
    SHELL=/bin/bash
    SKEL=/etc/skel
    CREATE_MAIL_SPOOL=yes

    You can also view the default parameters set for new user to be created using
    # useradd -D
    GROUP=100
    HOME=/home
    INACTIVE=-1
    EXPIRE=
    SHELL=/bin/bash
    SKEL=/etc/skel
    CREATE_MAIL_SPOOL=yes

    The second file containing values used by useradd command for UID, GID, password encryption method and expiry related information
    # less /etc/login.defs
    MAIL_DIR        /var/spool/mail

    PASS_MAX_DAYS   99999
    PASS_MIN_DAYS   0
    PASS_MIN_LEN    5
    PASS_WARN_AGE   7

    UID_MIN                   500
    UID_MAX                 60000

    GID_MIN                   500
    GID_MAX                 60000

    CREATE_HOME     yes
    UMASK           077

    USERGROUPS_ENAB yes
    ENCRYPT_METHOD SHA512

    Friday, April 11, 2014

    What is the difference/comparison between Unix and Linux ?

    There are not much differences between Linux and UNIX in terms of most of the commands and working if looking from an end-user perspective. But internally in the sense of hardware, kernel, patches etc there are numorous differences. 

    Well to be specific Linux is considered as Unix-Like Operating system coming under the category of UNIX clones. A clone is a program (i.e., an operating system or an application program) that has functions and behavior similar to another program but which does not contain source code from that program.

    License

    (History)
    UNIX was developed and evolved more as a licensed version or proprietary software.It was used more for commercial purpose. This was one of the reason for Linux to be developed as a free operating system by Linus Torvalds. Once the Linux kernel was developed later it was released under GPL (GNU General Public License) integrated with libraries, compilers, text editors transforming it into an operating system and releasing worldwide as opensource.

    (Present)
    Even now most UNIX operating system are proprietary as they are mostly commercially used like Oracle's Solaris, Hewlett-Packard's HP-UX, and IBM's AIX. Well there are also some open source OS for UNIX like Open Solaris, OpenBSD.

    Coming to Linux kernel you can find a long list of free and opensource operating system like CentOS, Scientific Linux, Fedora, OpenSUSE, Ubuntu etc. For commercial version there is Red hat Linux, SUSE etc.

    Hardware Architectures

    Linux can be much more flexible as compared to Unix as they can be installed on almost any hardware(NOT ALL). But Unix OS are very restricted when it comes for the supported hardware for example HP-UX is available on PA-RISC and Itanium machines. Solaris is available on SPARC and x86. AIX is only for power processors etc.

    Kernel

    Kernel can be considered the HEART of any operating system. Now as explained in the history part Linux is just an kernel and integrating it with other features like libraries, editors, compilers makes it an Operating System. 

    The source code for most UNIX kernel specially commercial versions are not available freely. On the other hand most Linux OS source code are free available under the GPL and can be read, modified and used by any and everyone.

    Patches and updates

    Linux being open source their patches are released in the form of source code which can be manually and updated. Now one negative point on this one can be that these patches are not much tested for bug as compared to commercial version of UNIX. In case of Linux based on the feedback of users and developers the bugs are fixed and patches are released. But in case of UNIX developers test the patch multiple times before releasing it to the update server of their OS.

    NOTE: In case of commercial version of Linux the patches are checked and verifed prior releasing it to their relative OS. Re-revised version of OS are released at regular intervals with all the bug fixes as developed.

    UNIX OS seems to be more stable in terms of releasing patches or upgrades and the code works for longer time for the same driver as compared to Linux.

    Filesystem support

    Linux has very high scalibility be it in terms of hardware architectures or filesystem as it suports many of them unlike UNIX OS which supports very few type of filesystem.

    Filesystem supported under Linux
    adfs, affs, autofs,  cifs,  coda, coherent,  cramfs,  debugfs,  devpts,  efs, ext, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, nfs4, ntfs, proc,  qnx4,  ramfs,  reiserfs,  romfs,  smbfs, sysv,  tmpfs,  udf, ufs, umsdos, usbfs, vfat, xenix, xfs, xiafs

    Filesystem supported under UNIX
    OS
    File system
    AIX
    jfs, gpfs
    HP-UX
    hfs, vxfs
    Solaris
    ufs, zfs
    Irix
    xfs

    System Administration Tools

    Well mostly Linux/Unix are preferred to be used on CLI rather than GUI in corporate world. But still to make things easier both the OS offer different type of GUI tools for administrators.

    In Red Hat - system-config-*
    In HP-UX - SAM (System Administration Manager)
    In SUSE - YaST

    As per the command perspective, there can be seen many differences 

    For example to install a package
    In Red Hat - rpm -i file
    In Solaris - pkgadd -d pkgfile
    IN HP-UX - swinstall -s depot software
    IN AIX- installp - [-c] FileSet

    System Initialization scripts

    Location of the system init scripts is different on both the types of OS
    System
    Location
    HP-UX
    /sbin/init.d
    AIX
    /etc/rc.d/init.d
    Irix
    /etc/init.d
    Solaris
    /etc/init.d
    Red Hat
    /etc/rc.d/init.d
    SUSE
    /etc/rc.d/init.d
    Debian
    /etc/init.d
    Slackware
    /etc/rc.d

    Cost

    As discussed in earlier part of this article most UNIX use their own hardware for their OS their cost price rises accordingly where on the opposite side getting a commercial version of Linux OS is very much cheaper.

    Examples for Linux and UNIX

    UNIX
    Linux
    HP-UX
    Red Hat
    AIX
    Debian
    Irix
    Ubuntu
    Solaris
    SUSE
    BSD
    CentOS

    Fedora

    Scientific Linux

    Slackware

    Reference:
    Differentiate Unix and Linux

    Related Articles:


    Follow the below links for more tutorials

    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    How to secure Apache web server in Linux using password (.htaccess)
    Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    How to log iptables messages in different log file

    How to fix "E575: viminfo: Illegal starting char in line"

    The other day I was trying to open a text file to work on it but surprisingly on my every attempt to open the file, the below error was coming up and not allowing me to edit or save the file.

    Error:

    $ vi IIG.TEST.2014-04-02.2014-04-07-00.26.30.000000.out
    E575: viminfo: Illegal starting char in line: ^I+^I3^I18
    E575: viminfo: Illegal starting char in line: ^I+^I3^I0
    E575: viminfo: Illegal starting char in line: ^I+^I3^I0
    E575: viminfo: Illegal starting char in line: ^I+^I3^I0
    E575: viminfo: Illegal starting char in line: ^I+^I3^I0
    E575: viminfo: Illegal starting char in line: ^I+^I3^I4
    E575: viminfo: Illegal starting char in line: ^I+^I3^I28
    E575: viminfo: Illegal starting char in line: ^I+^I3^I65
    E575: viminfo: Illegal starting char in line: ^I+^I6^I0
    E575: viminfo: Illegal starting char in line: ^I+^I3^I47
    E136: viminfo: Too many errors, skipping rest of file

    Reason:

    This happens because the user's viminfo file gets corrupted somehow and certain characters are not interpretted so everytime you try to open the original file, it throws out "Illegal starting char in line"

    Solution:

    You can delete the user's viminfo file from the user's home directory using which you were getting the error. 

    NOTE: You can find .viminfo inside every user's home directory starting with a dot (.) as it is a hidden file.

    What is .viminfo file? 
    This file contains the history of all the vim editor records i.e the files edited and the arguments you used inside the editor etc. 

    Will it affect my current saved work?
    No deleting .viminfo file is not going to affect any of your existing work, It is the same way you erase your cache history but it does not affects any of your work done.

    Do I need to recreate a new .viminfo file?
    No, this file gets automatically created inside user's home directory as soon you start working on any text file using vi editor.


    Follow the below links for more tutorials

    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    How to secure Apache web server in Linux using password (.htaccess)
    Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    How to log iptables messages in different log file

    Wednesday, April 09, 2014

    What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?

    Below chart shows you the comparison of various features of Red Hat Enterprise Linux between version 4, 5 and 6.


    Version 4
    Version 5
    Version 6
    Maximum Logical CPUs



    X86
    32
    32
    32
    Itanium 2
    256/512
    256/1024
    NA
    X86_64
    64/64
    160/255
    160/4096
    POWER
    64/128
    128/128
    128




    Maximum Memory



    X86
    64GB
    16GB
    16GB
    Itanium 2
    2TB
    2TB
    NA
    X86_64
    256GB/1TB
    1TB
    3TB/64TB
    POWER
    128GB/1TB
    512GB/1TB
    2TB