It's highly dangerous to mess around with system files (e.g. password files) NOT using the tools designed for it. You might end up not being able to access the system.
For the sheer exercise: How is the user identified - by user name (field 1), UID (field 3), or both? And, it's just about field 2, so all the other fields in file 2 will stay the same? Assuming both, why don't you copy the entire line?
Try
I have 2 files - fileA and fileB
I need to match the first field of the 2 files then output some of the fields from fileA on the same line as certain fields from fileB.
There will be instances where fileB does not have a match for first field in fileA
Thanks in advance (8 Replies)
I want to count the number of occurence of perticular word from one text file.
Please tell me "less" command is work in ksh or not. If it is not working then instead of that which command will work. :confused: (40 Replies)
Hi,
We need to configure some of the fileds in bugzilla like Platform,OS, Version etc are mandatory. Is it possible to set, if yes then how to configure.
Thanks & Regards,
Bache (0 Replies)
Hi all,
I am new to UNIX, so sorry if my question seem stupid to u.
well i want to replace the first character of first 30 lines of a file, only if the first character is h.
and
in anothe script i want to replace a particular string/character say hello/h of a file.Condition: It should... (1 Reply)
Hi Friends,
Please help me in finding the solution for this :
I have a file as below :
CuDv:
name = "hdisk0"
status = 1
chgstatus = 2
ddins = "scsidisk"
location = ""
parent = "vscsi0"
connwhere = "830000000000"
PdDvLn... (3 Replies)
Dear All,
I need a unix script that will read the 7th line and especially these fileds from a file Mo speed 16, Mt speed 15 every 15 minutes starting from 00:00 to 23:45 on daily basis and put the result in a txt file and name it MT_MO_20090225.txt, please also note that the system date format... (2 Replies)
I have following text:
NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE , ONLINE , ONLINE , ONLINE
STATE=ONLINE on host1, ONLINE on host2, ONLINE on host3, ONLINE on host4
NAME=ora.LISTENER_1525.lsnr
TYPE=ora.listener.type
TARGET=ONLINE ... (2 Replies)
Dear All
I have a text file which has many columns (>10,000). I want to create a new text file which will NOT include following columns: 5,15,105,200. How can I do that in shell (or awk, perl)? Thanks. (6 Replies)
How to list todays file in perticular folder
Moved thread to appropriate forum (9 Replies)
Discussion started by: pspriyanka
9 Replies
LEARN ABOUT REDHAT
pwck
PWCK(1) General Commands Manual PWCK(1)NAME
pwck - verify integrity of password files
SYNOPSIS
pwck [-sr] [passwd shadow]
DESCRIPTION
pwck verifies the integrity of the system authentication information. All entries in the /etc/passwd and /etc/shadow are checked to see
that the entry has the proper format and valid data in each field. The user is prompted to delete entries that are improperly formatted or
which have other incorrectable errors.
Checks are made to verify that each entry has
- the correct number of fields
- a unique user name
- a valid user and group identifier
- a valid primary group
- a valid home directory
- a valid login shell
The checks for correct number of fields and unique user name are fatal. If the entry has the wrong number of fields, the user will be
prompted to delete the entire line. If the user does not answer affirmatively, all further checks are bypassed. An entry with a dupli-
cated user name is prompted for deletion, but the remaining checks will still be made. All other errors are warning and the user is
encouraged to run the usermod command to correct the error.
The commands which operate on the /etc/passwd file are not able to alter corrupted or duplicated entries. pwck should be used in those
circumstances to remove the offending entry.
OPTIONS
By default, pwck operates on the files /etc/passwd and /etc/shadow. The user may select alternate files with the passwd and shadow parame-
ters. Additionally, the user may execute the command in read-only mode by specifying the -r flag. This causes all questions regarding
changes to be answered no without user intervention. pwck can also sort entries in /etc/passwd and /etc/shadow by UID. To run it in sort
mode pass it -s flag. No checks are performed then, it just sorts.
FILES
/etc/passwd - user account information
/etc/shadow - encrypted password information
/etc/group - group information
SEE ALSO group(5), passwd(5), shadow(5), usermod(8)DIAGNOSTICS
The pwck command exits with the following values:
0 Success
1 Syntax Error
2 One or more bad password entries
3 Cannot open password files
4 Cannot lock password files
5 Cannot update password files
AUTHOR
Julianne Frances Haugh (jockgrrl@ix.netcom.com)
PWCK(1)