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.
as far I know md5sum generate a number which is used to check the integrity of file between source and destination. However when i run this command,
"ps awx | md5sum", I am getting md5 code which keeps changing everytime the mentioned command is ran . Could someone explain what is md5sum is doing with respect to ps command?
md5sum, when provided with data on stdin, will generate the checksum of that data regardless of what it is. For example:
Code:
echo "hat" | md5sum
will return the md5 hash for the string "hat", which is "80c7384a6339a053baee278cb13e578c", and it will be the same every time you run it.
When you run "ps awx | md5sum", you're computing the md5 hash of the output of "ps aux". Since the output of "ps aux" is different every time you run it (processes starting/stopping, different runtimes for existing processes, etc.), naturally the md5 hash will be different as well.
Last edited by suicidaleggroll; 04-06-2016 at 01:44 PM.
Probably they're just experimenting with md5sum. There's no value doing a md5sum on the output of ps unless they just wanted to generate a string of characters to use for something else.
I look at md5sum as a quick way of signing files and checking the sums. I prefer to use GPG to sign files and use a signature key to verify the integrity of my files.
They might have thought of it as "a random string," on the presumption that the output of "ps" would never be exactly the same. But, I don't like to see code that incorporates either "assumptions" or "cleverness."
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.