Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
md5 question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mbjr
Guru
Guru


Joined: 17 Jan 2004
Posts: 531
Location: Budapest/Hungary

PostPosted: Wed Oct 06, 2004 6:09 pm    Post subject: md5 question Reply with quote

Hi :-)

I'm just qurious if there's any way to create an MD5 of a file which should contain the md5 code that is created :-) So basicly I have a file:

myfiletomd5.dat

cat myfiletomd5.dat says:
MD5 F83DAEB045B592D2D67F288EA3C0E268 myfiletomd5.dat

and how do I make this content replaced by creating an md5 of the file? :P Is it possible? Is there any way to calculate such thing?
_________________
mb
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20583

PostPosted: Wed Oct 06, 2004 6:16 pm    Post subject: Reply with quote

Moved from Other Things Gentoo.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
flindt
Tux's lil' helper
Tux's lil' helper


Joined: 10 Dec 2003
Posts: 112
Location: Denmark

PostPosted: Wed Oct 06, 2004 7:10 pm    Post subject: Reply with quote

Outputs from commands can be piped to a file by using '>' or '>>', the first will overwrite the file and the latter will append to it.

Code:
md5sum somefile > somefile.md5
cat somefile.md5
3e73db51c0c311b4de07a652fb9be12c somefile

or if you need the MD5 tag in there
Code:

echo MD5 > somefile.md5
md5sum somefile >> somefile.md5
cat somefile.md5
MD5 3e73db51c0c311b4de07a652fb9be12c somefile

the other way works too! '<' will pipe from a file to the command
Code:
md5sum --check < somefile.md5

however only if the MD5 tag is not in the file...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum