Tuesday, 31 July 2012

How to know the size of a directory in your system

To know the size of a directory

$ du -sh directory_name


Example is show in figure below


How to know the memory usage in your system

To know the memory usage in your system, type

$ free -m

Example is shown in fig below



Friday, 27 July 2012

How to give a temporary ip address in your system

For temporary network configuration you have to use 'ifconfig' command. This command configures the setting immediately and will b lost after a reboot.

$ sudo ifconfig eth0 192.168.1.2 netmask 255.255.255.0

Here we are configuring to eth0. After this command to check the present network interface you have to type the command

$ ifconfig eth0

Then will give the details of the eth0 ( example is show figure below)



How to find out the network interface available in your system

There is a command called 'lshw', it can identify all network interfaces in your system.

$ sudo lshw -class network







the above figure show all the information of bus information, product & vendor details,diver details and all other supported capabilities.

Thursday, 26 July 2012

How to print the user id, group id, effective id and the supplementary groups

To print the user id (uid) and group id (gid), effective id (if different than the real id) and the supplementary groups.

    $ id username







`id' prints information about the given user, or the process running it
if no user is specified.By default, it prints the real user ID, real group ID, effective user ID if different from the real user ID, effective group ID if
different from the real group ID, and supplemental group IDs. In addition,
if SELinux is enabled and the `POSIXLY_CORRECT' environment variable
 is not set, then print `context=C', where C is the security context.