Results 1 to 3 of 3

Thread: md5sum output

  1. #1
    Join Date
    Mar 2012
    Beans
    12

    md5sum output

    Hi folks,

    When running the md5sum function from the terminal the returned output includes the checksum and the filename (or file path and name if called from a script).

    So if I run:

    Code:
    md5sum filename.extension
    I get the following output:

    Code:
    0b82b43abeeec299ba9f56d6e3dc03a0  filename.extension
    Is it possible to suppress the filename (or filepath/name) element of this output so I just get the following?

    Code:
    0b82b43abeeec299ba9f56d6e3dc03a0
    Thanks in advance for any help.

  2. #2
    Join Date
    Mar 2012
    Beans
    308

    Re: md5sum output

    You can split the output using the cut command:
    Code:
    md5sum filename.extension | cut -d" " -f1
    Read the manual page for more information:
    Code:
    man cut

  3. #3
    Join Date
    Mar 2012
    Beans
    12

    Re: md5sum output

    Thanks brainwash. That works perfectly.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •