Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

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
NAME
   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 http://stackoverflow.com/a/9405342https://stackoverflow.com/a/9405342, we can use

/dev/tty

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 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
NAME
   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 http://stackoverflow.com/a/9405342, we can use

/dev/tty

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 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
NAME
   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

/dev/tty

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 :)

Source Link
Travis
  • 296
  • 1
  • 5

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
NAME
   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 http://stackoverflow.com/a/9405342, we can use

/dev/tty

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 :)