I have not used the md5deep
tool, but I believe those lines are error messages; they would be going to standard error instead of standard out, and so they are going directly to your terminal instead of through the pipe. Thus, they won't be filtered by your sed command. You could filter them by merging your standard error and standard output streams, but
It looks like (I'm not sure because you are missing the backquotes) you are trying to call
md5deep `find *`
and find is returning all of the files and directories.
Some notes on what you might want to do:
It looks like md5deep
has a -r for "recursive" option. So, you may want to try:
md5deep -r *
instead of the find command.
If you do wish to use a find
command, you can limit it to only files using -type f
, instead of files and directories. Also, you don't need to pass *
into a find command (which may confuse find
if there are files that have names that looks like the options that find
understands); passing in .
will search recursively through the current directory.
find . -type f
In sed
if you wish to use slashes in your pattern, it can be a pain to quote them correctly with \. You can instead choose a different character to delimit your regular expression; sed
will use the first character after the s
command as a delimiter. Your pattern is also lacking a .
; in regular expressions, to indicate one instance of any character you use .
, and to indicate "zero or more of the preceding expression" you use *
, so .*
indicates "zero or more of any character" (this is different from glob patterns, in which *
alone means "zero or more of any character").
sed "s|/.*||g"
If you really do want to be including your standard error stream in your standard output, so it will pass through the pipe, then you can run:
md5deep `find *` 2>&1 | awk ...
If you just want to ignore stderr, you can redirect that to /dev/null
, which is a special file that just discards anything that goes into it:
md5deep `find *` 2>/dev/null | awk ...
In summary, I think the command below will help you with your immediate problem, and the other suggestions listed above may help you if I did not undersand what you were looking for:
md5deep -r * | awk '{ print $1 }'