Feeds:
Posts
Comments

Archive for June, 2007

/etc/passwd(in linux)

Lets talk about the configuration file /etc/passwd in a linux system.

This file is the main configuration file for a linux user. It contains the user details of the particular system.In this file a single line represents a single user. Let us encounter an example:

[ria@localhost python]$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:

Here the number of rows denotes the number of columns.Here we can see that each row has 7 columns. Let us take the example of the 1st row. Here ‘root’ is the username; ‘x’ is the encrypted password (the password is found in /etc/shadow file); ‘0’(zero) denotes the account UID; ‘0’(zero) of the next column denotes the group ID; ‘root’ denotes the comment (generally the real name of the account holder); ‘/root’ denotes the home directory; ‘/bin/bash’ denotes the shell.

To see the line containing a particular word we can use the grep command as shown in the following example:

To see the line containing the word lp in the file /etc/passwd we write:

[ria@localhost ~]$ cat /etc/passwd | grep lp

lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
Advertisements

Read Full Post »

At last my exams are over.So started again working over my Summer of Code project.Those days of exam were very hectic for me,I could not work much.Now I am in Bangalore.

Read Full Post »