07-15-2011
Number of records in a file of a particular directory
Hi All,
I want to find the number of records in a file of a particular directory
I have a file as abcd.txt in the path
var/hr/payments/
I want to find number of records in abcd.txt file in a single command.
I tried the following
cd /var/hr/payments/wc -l abcd.txt
I got the error "ksh: cd: bad argument count"
Please help me to get this.
Thanks in advance.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi gurus
i'm trying to get the count of number of records of a file
as : wc -l file1.txt
iam getting the correct count by in out put i'm getting the file name too
i get the output as follows "7 file1.txt"
my question is how to avoid filename in the output.
might be a basic... (20 Replies)
Discussion started by: sish78
20 Replies
2. Shell Programming and Scripting
I have a flat file and need to count no of records in the file less the header and the trailer record.
I would appreciate any and all asistance
Thanks
Hadi Lalani (2 Replies)
Discussion started by: guiguy
2 Replies
3. UNIX for Advanced & Expert Users
I want to retain specific number of backup files in a directory.for example i want to retain only two latest backup file in backup directory. If number of backup files is greater than this policy that it will delete oldest file.Please Tell me whether this is possible or not. (2 Replies)
Discussion started by: ranvijaidba
2 Replies
4. UNIX for Dummies Questions & Answers
Hi everyone.
I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this:
ID: 20
Name: X
Age: 19
ID: 21
Name: Z
ID: 22
Email: xxx@yahoo.com
Name: Y
Age: 19
I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies
5. UNIX for Advanced & Expert Users
Hi all
Thanks in advance...........
Please help me for this issue............
I have a file it has 11 records . I used the command like ....
>$ wc -l file
11 file
I'm getting output like 11 file (no.of records along with filename)
here my requirement is, I want to display only... (3 Replies)
Discussion started by: ksrivani
3 Replies
6. Shell Programming and Scripting
Hi,
I have a comma (,) delimited file, in which few fields are enclosed with in double quotes " ". I have to print the records in the file which donot have expected number of field with the line number.
File1
====
name,desgnation,doj,project #header#... (7 Replies)
Discussion started by: machomaddy
7 Replies
7. Shell Programming and Scripting
I would like to print the number of records of 2 files, and divide the two numbers
awk '{print NR}' file1 > output1
awk '{print NR}' file2 > output2
paste output1 output2 > output
awl '{print $1/$2}' output > output_2
is there a faster way? (8 Replies)
Discussion started by: programmerc
8 Replies
8. Shell Programming and Scripting
Given a file like this:
abc
def
ghi
I need to get to
somestandardtext abc1 morestandardtext
somestandardtext def2 morestandardtext
somestandardtext ghi3 morestandardtext
Notice that in addition to the standard text there is the line number added in as well. What I conceived is... (4 Replies)
Discussion started by: edstevens
4 Replies
9. Shell Programming and Scripting
Hi Freinds ,
I have 2 files .
File 1
|nag|HYd|1|Che
|esw|Gun|2|hyd
|pra|bhe|3|hyd
|omu|hei|4|bnsj
|uer|oeri|5|uery
File 2
|nag|HYd|1|Che
|esw|Gun|2|hyd
|uer|oi|3|uery
output : (9 Replies)
Discussion started by: i150371485
9 Replies
10. Shell Programming and Scripting
Hi!
I just want to count number of files in a directory, and write to new text file, with number of files and their name
output should look like this,,
assume that below one is a new file created by script
Number of files in directory = 25
1. a.txt
2. abc.txt
3. asd.dat... (20 Replies)
Discussion started by: Akshay Hegde
20 Replies
LEARN ABOUT CENTOS
ldns-gen-zone
ldns-gen-zone(1) General Commands Manual ldns-gen-zone(1)
NAME
ldns-gen-zone - read a zonefile and print it while adding DS records and extra RR's
SYNOPSIS
ldns-gen-zone ZONEFILE
DESCRIPTION
ldns-gen-zone reads a DNS zone file and prints it.
It is build for speed, not for a nice formatting. The output has one resource record per line and no pretty-printing makeup.
DNSSEC data (NSEC, NSEC3, RRSIG or DNSKEY) is not stripped. You may want to use ldns-read-zone for that. Existing DS records are also not
stripped.
The idea is to use this tool for quickly generating a representative artificial zonefile from a real zonefile, to use it for testing pur-
poses.
OPTIONS
-a NUM Adds NUM extra artificial NS RRSets to the output. The RRSets owner names start with 'xn--' in an attempt to ensure uniqueness
(nl.-zone does not support IDN's - and this tool was written with that knowledge in mind).
An artificial NS RRSet has two NS records; ns1.example.com and ns2.example.com.
-p NUM Add NUM% of DS RRSets to the NS RRSets (anywhere between 1-4 DS records per RRSet).
-o ORIGIN
Sets an $ORIGIN, which can be handy if the one in the zonefile is set to '@' for example. If there is an $ORIGIN in the zonefile,
this option will silently be ignored.
-s This is the recommended way of processing large zones that are already sorted and canonicalized (ie lowercase). It skips the sorting
and canonicalization step that is required for properly grouping RRSets together (before adding any DS records to them. Skipping
this step will speed things up.
It is not recommended to use this option if you want to add DS records to unsorted, non-canonicalized zones.
-h Show usage and exit.
-v Show version and exit.
EXAMPLES
ldns-gen-zone -a 100000 -p 10 -s ./zonefile.txt
Read a zonefile, add 100.000 artificial NS RRSets and 10% of DS records, print it to standard output. Don't sort (will only work
well if the input zonefile is already sorted and canonicalized).
ldns-gen-zone -p 10 -s -o nl zonefile.txt | named-compilezone -s relative -i none -o zonefile_10.txt nl /dev/stdin
This creates a nicely formatted zone file with the help of named-compilezone. It adds 10% DS records to the .nl zone, reformats it
and saves it as zonefile_10.txt.
AUTHOR
Initially written by Marco Davids, several modifications added by Miek Gieben, both from SIDN.
REPORTING BUGS
Report bugs to <ldns-team@nlnetlabs.nl>.
BUGS
Only undiscovered ones.
CAVEATS
May require a machine with a considerable amount of memory for large zone files.
Fake DS records hashes are generated as digest type SHA-256 (RFC4509). Be aware not to change the DIGESTTYPE #define in the source code in
anything else but 2 if you want to keep things realistic.
Despite a number of efforts, this program is still not the fastest in the world.
COPYRIGHT
Copyright (C) 2010 SIDN. This is free software. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 June 2010 ldns-gen-zone(1)