Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
From my knowledge based on Java, hash is a integer that can be generated from a file. Hash allows you to compare if two files are NOT equal, and gives you a swift retrieval of files. Anyone correct me if i am not wrong.
cryptographic signature of some data, created using a one-way algorithm
as per Ser Olmy.
Also the verb to do.
2. An indexed data structure ie a set of: key => value pairs.
The key can be any (reasonable) string (inc integer) eg prob not using ctrl chars etc.
In the Perl lang a hash is a basic var type eg http://www.perlmonks.org/?node_id=471590
NB: these are known in some langs as 'associative arrays' even as a 'map' in some cases.
EG in php, 'arrays' are really of the associative type, rather than the traditional eg C, Perl integer indexed style http://www.php.net/manual/en/function.array.php
3. Of course, you can save a hash (of type 2) to disk eg in Perl a Tied::Hash and this would be a file in hash table format; that's probably(?) what the qn means...
The question as given by my instructor is the first one:
"What type of file is 'hash'?"
To me, the question seems like it's saying there is a file named hash and then asking what type of file is hash. That's why I asked if there was a file named hash so I could then proceed to find what type of file it is, if it did indeed exist.
It's not asking what kind of file type is hash, it's asking what kind of file is hash. Make sense? Hopefully, because I'm lost.
@nicnicman::
Before answering to your question, let's know what is hash? In UNIX you can find kind of file or kind of file type (though both sounds same at the end), using file command:-
Code:
~$ file <filename>
For example:-
Code:
~$ file hash
hash: cannot open: No such file or directory
So the first question is that, is there any file named 'hash' exists? If it exists, you can use file to check it's kind, else not.
Moreover, once go through Unix file types, which explains file type in Unix in details.
On the other hand, just a guess, the "#" symbol is also called 'hash' and frequently used in UNIX. So make sure that your concern is a file named 'hash', not the symbol "#".
Last edited by shivaa; 02-07-2013 at 08:32 PM.
Reason: Typo
As per above comments, you can have a file whose name is 'hash', you can even have a file whose name is '#', but neither of these are std files on a *nix system (especially '#' !).
(NB: if he expects you to check a system that he's setup with a file with one of those names, that's different.
In that case, use the 'file' cmd as above)
In other words, your instructor's qn is vague (although he may not mean it to be).
I'd collect all the possible answers here and send them to him; maybe you'll get bonus pts
As per above comments, you can have a file whose name is 'hash', you can even have a file whose name is '#', but neither of these are std files on a *nix system (especially '#' !).
(NB: if he expects you to check a system that he's setup with a file with one of those names, that's different.
In that case, use the 'file' cmd as above)
In other words, your instructor's qn is vague (although he may not mean it to be).
I'd collect all the possible answers here and send them to him; maybe you'll get bonus pts
Where using our own systems so it's not a file he put on the system. Thanks for all the suggestions. As you say, I'll bundle them up and ask him about it.
One alternate description is a "dictionary file". The original UNIX spell utility would split off prefixes and suffixes, then generate a hash of the root word. If the bit corresponding to the integer hash value was set in the dictionary file, then the word was properly spelled. If the bit was clear, then it is misspelled. Doesn't help much for fixing (that took additional work and a recheck), but it is a very fast check, making good use of sparse files (the dictionary file length might have been several hundred MB, but only occupy a couple of hundred blocks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.