View previous topic :: View next topic |
Author |
Message |
mbjr Guru
Joined: 17 Jan 2004 Posts: 531 Location: Budapest/Hungary
|
Posted: Wed Oct 06, 2004 6:09 pm Post subject: md5 question |
|
|
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? Is it possible? Is there any way to calculate such thing? _________________ mb |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20583
|
Posted: Wed Oct 06, 2004 6:16 pm Post subject: |
|
|
Moved from Other Things Gentoo. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
flindt Tux's lil' helper
Joined: 10 Dec 2003 Posts: 112 Location: Denmark
|
Posted: Wed Oct 06, 2004 7:10 pm Post subject: |
|
|
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 |
|
|
|