I would like to create a .txt file for each filesystem ( so hd1.txt, hd2.txt, hd3.txt and hd4.txt ) and put in each .txt file the sum of the value from each FS from each dataX.txt. I've some difficulties to explain in english what I want, so here an example of the result wanted
Expected content for the output file `hd1.txt`:
Expected content for the file `hd2.txt`:
hi.i want to create a bash script called countfiles.sh, that will count the pack of files under the current file that their term satisfy a specific pattern. The script must show the total per file or on the whole.
thank tou (4 Replies)
Hey guy,
how to make bash script to create foo.txt file and add current date into file content and that file always append.
example: today the script run and add today date into content foo.txt
and tomorrow the script will run and add tomorrow date in content foo.txt without remove today... (3 Replies)
hi all
I am new to unix and want to create a loop to repeat the loop and before that it ask me to do so.I know "while" may help but I put it in my work and getting stuk with it.any help appreciated. (13 Replies)
Hi ,
please guide me for a bash script that will create a txt files and the name of the txt files will be as of timestamp so that each file name will be different from other and these files will be get created say after every 10 minutes in a folder(/home/p2000/sxs137), please guide me how would... (1 Reply)
Hi Guys,
I have file A.txt
File A Data
AK1521
AK2536
AK3164
I want create text file of all data above and write some data on each file.
want Output on below folder
/home/kka/out
AK1521.txt
Hi
Welocme (3 Replies)
My Calling script is like below:
for file in `echo $LIST_OF_FILES` --listing filenames eg, xyz_meta_20110501_00000789.tar
do
file_name=`basename $file`
<call a function to create .txt file in below format>
done
Want to generate a .txt file that contains below data in ksh:
... (3 Replies)
Hi,
I need to create a .csv file from information that i have in two different tab delimited .txt file. I just want to select some of the columns of each .txt file and paste them into a .cvs file.
My files look like:
File 1
transcript_id Seq. Description Seq. Length ... (2 Replies)
I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
I have a txt file with a list of error messages in a xml tag format, and each error message is separated with a identifier(endresult).Need to split that and copy and create a new html file.Error message has some special character. how to escape the special character and insert my data into the... (7 Replies)
Discussion started by: DevAakash
7 Replies
LEARN ABOUT DEBIAN
hfind
HFIND(1) General Commands Manual HFIND(1)NAME
hfind - Lookup a hash value in a hash database
SYNOPSIS
hfind [-i db_type ] [-f lookup_file ] [-eq] db_file [hashes]
DESCRIPTION
hfind looks up hash values in a database using a binary search algorithm. This allows one to easily create a hash database and identify if
a file is known or not. It works with the NIST National Software Reference Library (NSRL) and the output of 'md5sum'.
Before the database can be used by 'hfind', an index file must be created with the '-i' option.
This tool is needed for efficiency. Most text-based databases do not have fixed length entries and are sometimes not sorted. The hfind
tool will create an index file that is sorted and has fixed-length entries. This allows for fast lookups using a binary search algorithm
instead of a linear search such as 'grep'.
ARGUMENTS -i db_type
Create an index file for the database. This step must be done before a lookup can be performed. The 'db_type' argument specifies
the database type (i.e. nsrl-md5 or md5sum). See section below.
-f lookup_file
Specify the location of a file that contains one hash value per line. These hashes will be looked up in the database.
-e Extended mode. Additional information besides just the name is printed. (Does not apply for all hash database types).
-q Quick mode. Instead of displaying the corresponding information with the hash, just display 0 if the hash was not found and 1 if it
was. If this flag is used, then only one hash can be given at a time.
-V Display version
db_file
The location of the hash database file.
[hashes]
The hashes to lookup. If they are not supplied on the command line, STDIN is used. If index files exist for both SHA-1 and MD5
hashes, then both types of hashes can be given at runtime.
INDEX FILE
hfind uses an index file to perform a binary search for a hash value. This is much faster than using 'grep', which will do a linear search.
Before a hash database is used, a corresponding index file must be created. This is done with the '-i' option to hfind.
The resulting index file will be named based on the database file name. The name will have the original name following by the hash type
(sha1 or md5) followed by '.idx'. For example, creating an MD5 hash index of the NIST NSRL results in 'NSRLFile.txt-md5.idx' and the SHA-1
index results in 'NSRLFile.txt-sha1.idx'.
The file has two columns. Each entry is sorted by the first column, which is the hash value. The second column has the byte offset of the
corresponding entry in the original file. So, when a hash is found in the index, the offset is recorded and then 'hfind' seeks to the
entry in the original database.
The following input types are valid. For NSRL, 'nsrl-md5' and 'nsrl-sha1' can be used. The difference is which hash value the index is
sorted by. The 'md5sum' value can also be used to sort and index "home made" databases. 'hfind' can take data in both common formats:
MD5 (test.txt) = 76b1f4de1522c20b67acc132937cf82e
and
76b1f4de1522c20b67acc132937cf82e test.txt
EXAMPLES
To create an MD5 index file for NIST NSRL:
# hfind -i nsrl-md5 /usr/local/hash/nsrl/NSRLFile.txt
To lookup a value in the NSRL:
# hfind /usr/local/hash/nsrl/NSRLFile.txt 76b1f4de1522c20b67acc132937cf82e
76b1f4de1522c20b67acc132937cf82e Hash Not Found
You can even do both SHA-1 and MD5 if you want:
# hfind -i nsrl-sha1 /usr/local/hash/nsrl/NSRLFile.txt
# hfind /usr/local/hash/nsrl/NSRLFile.txt
76b1f4de1522c20b67acc132937cf82e
80001A80B3F1B80076B297CEE8805AAA04E1B5BA
76b1f4de1522c20b67acc132937cf82e Hash Not Found
80001A80B3F1B80076B297CEE8805AAA04E1B5BA thrdcore.cpp
To make a database of critical binaries of a trusted system, use 'md5sum':
# md5sum /bin/* /sbin/* /usr/bin/* /usr/bin/* /usr/local/bin/* /usr/local/sbin/* > system.md5
# hfind -i md5sum system.md5
To look entries up, the following will work:
# hfind system.md5 76b1f4de1522c20b67acc132937cf82e
76b1f4de1522c20b67acc132937cf82e Hash Not Found
or
# md5sum -q /bin/* | hfind system.md5
928682269cd3edb1acdf9a7f7e606ff2 /bin/bash
<...>
or
# md5sum -q /bin/* > bin.md5
# hfind -f bin.md5 system.md5
928682269cd3edb1acdf9a7f7e606ff2 /bin/bash
<...>
SEE ALSO sorter(1)
The NIST National Software Reference Library (NSRL) can be found at www.nsrl.nist.gov.
LICENSE
Distributed under the Common Public License, found in the cpl1.0.txt file in the The Sleuth Kit licenses directory.
AUTHOR
Brian Carrier <carrier at sleuthkit dot org>
Send documentation updates to <doc-updates at sleuthkit dot org>
HFIND(1)