I want to search some text output by command docker
, but it seems not work with pipeline.
My expected result of docker > a
should write all output in the terminal to file a. And expected result of docker | grep info
should print something that contains info Display system-wide information
.
I added myself to the group docker. The following is test cases.
lala@ubu:~/projects/docker 14:19:42 $ grep docker /etc/group docker:x:999:lala lala@ubu:~/projects/docker 14:19:47 $ ls -al 总用量 8 drwxr-xr-x 2 lala lala 4096 1月 10 14:15 . drwxr-xr-x 10 lala lala 4096 1月 10 10:21 .. lala@ubu:~/projects/docker 14:19:57 $ ls -al | grep x drwxr-xr-x 2 lala lala 4096 1月 10 14:15 . drwxr-xr-x 10 lala lala 4096 1月 10 10:21 .. lala@ubu:~/projects/docker 14:20:01 $ docker Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers Options: ...... unnecessary output Run 'docker COMMAND --help' for more information on a command. lala@ubu:~/projects/docker 14:20:03 $ docker | grep x Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers Options: ...... the same as above. unnecessary output Run 'docker COMMAND --help' for more information on a command. lala@ubu:~/projects/docker 14:20:15 $ docker > a Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers Options: ...... the same as above again. unnecessary output Run 'docker COMMAND --help' for more information on a command. lala@ubu:~/projects/docker 14:21:26 $ cat a lala@ubu:~/projects/docker 14:21:28 $ file a a: empty lala@ubu:~/projects/docker 14:21:30 $
docker >> a
did not work, either.