I am running a command which does a quick checksum of some file like so

find / -type f -ctime +30 -mtime +30 -atime +30 -exec md5sum {} \; | xargs -P 4

and I am trying to run it in parallel with

xargs -P 4

Now, when I run the find command, by itself, I see output as each file is being checksummed. But when I pipe it to xargs, I no longer see the output of the find command.

Is there a way I could see the output of find when it is piped to another command?

2 Answers 2


You want this:

find / -type f -ctime +30 -mtime +30 -atime +30 -print0 | xargs -0 -P 4 md5sum

You want the list of files to be fedinto the md5sum command. This is done with find / | xargs md5sum. Then you want to not have to worry about crazy characters (spaces, newlines, whatever) in filenames, so we use -print0 for find and -0 for xargs.


I took your command,

$ find / -type f -ctime +30 -mtime +30 -atime +30 -exec md5sum {} \; | xargs -P 4

And figured we want to redirect, while still echoing to stdout. One way we can do this is with tee

$ man tee | head
   tee - read from standard input and write to standard output and files

So, tee will definitely write to stdout (which is what we need to continue the chain), and also write to a file of our choosing. Great! But what file?

Thanks to this answer for the idea https://stackoverflow.com/a/9405342, we can use


for our redirect, and it will print to our console!

So, for the full command:

$ find / -type f -ctime +30 -mtime +30 -atime +30 -exec md5sum {} \; | tee /dev/tty | xargs -P 4

I start seeing some great text roll down the screen as I do that :)

  • I like your answer because I wouldn't have thought of using tee to output it to /dev/tty. Thank you very much May 1, 2014 at 1:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .