LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-07-2013, 04:10 PM   #1
nicnicman
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Rep: Reputation: Disabled
What type of file is hash?


For a homework question I was asked "What type of file is 'hash'?" But, isn't hash a command?

Btw, we're allowed to seek help on the assignment.

Thanks for any suggestions.
 
Old 02-07-2013, 04:33 PM   #2
ted_chou12
Member
 
Registered: Aug 2010
Location: Zhongli, Taoyuan
Distribution: slackware, windows, debian (armv4l GNU/Linux)
Posts: 431
Blog Entries: 32

Rep: Reputation: 3
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.
 
Old 02-07-2013, 04:35 PM   #3
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,340

Rep: Reputation: Disabled
The question doesn't really make sense. Does it appear in a particular context?

A hash is a cryptographic signature of some data, created using a one-way algorithm. The length of the hash depends on the algorithm being used.

I've never heard of a file type called "hash".
 
Old 02-07-2013, 06:23 PM   #4
nicnicman
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
The question is a separate question by itself without any other context. It is as I wrote it between the double quotes.

Is there a file named 'hash'?

Thanks for the suggestions.
 
Old 02-07-2013, 06:31 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
There's no file type of hash.

Hash can be:

1.
Quote:
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...

HTH

Last edited by chrism01; 02-07-2013 at 06:33 PM.
 
Old 02-07-2013, 07:18 PM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Actually the OP has asked 2 different questions so it may be prudent to ask which is correct:

"What type of file is 'hash'?" post #1

Is there a file named 'hash'? post #4

The second would lead me to believe you are supposed to find if a file 'named' "hash" in a particular location


Please clarify?
 
Old 02-07-2013, 07:41 PM   #7
nicnicman
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
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.

Last edited by nicnicman; 02-07-2013 at 07:43 PM.
 
Old 02-07-2013, 08:26 PM   #8
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
@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
 
Old 02-07-2013, 08:38 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
@OP: see my previous response.

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
 
Old 02-07-2013, 09:18 PM   #10
nicnicman
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
@OP: see my previous response.

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.
 
Old 02-07-2013, 09:24 PM   #11
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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.
 
Old 02-08-2013, 06:46 AM   #12
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
A "tied hash" as used in Perl is a Berkeley DB (or similar) file also being used as a Perl hash data type.
 
Old 02-08-2013, 08:47 AM   #13
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
maybe they are referring to some kind of ascii-txt file which contains some hash key information (md5sum/sha-1/id_dsa.pub/id_rsa.pub) ?

Last edited by schneidz; 02-08-2013 at 08:48 AM.
 
Old 02-09-2013, 01:41 PM   #14
vikky
LQ Newbie
 
Registered: Apr 2012
Posts: 26
Blog Entries: 1

Rep: Reputation: Disabled
there is no file called hash in unix
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Please help with hash type patapout Linux - Newbie 2 05-13-2012 07:50 AM
What type of hash it is? umair344 Linux - Security 2 08-04-2010 05:43 PM
Recognising hash type? chrisgti Linux - Security 4 03-25-2009 03:22 PM
What type of password hash is this ? memo007 Linux - Security 7 12-26-2007 02:34 AM
Linux coding type (hash) xtreme17 Linux - Security 7 11-03-2003 01:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration