How to simplify reroutes in bash

How to simplify the following command line in bash:

make install 1>/dev/null && update-initramfs -k all -u 1>/dev/null

I want to redirect all stdout output from both commands to / dev / null.

+4
source share
1 answer

A trivial simplification is to remove 1s, as they are the default file descriptors for redirecting output.

make install >/dev/null && update-initramfs -k all -u >/dev/null

But I suspect you're looking for a group of commands to aggregate standard output:

{ make install && update-initramfs -k all -u; } > /dev/null
+6
source

Source: https://habr.com/ru/post/1529271/


All Articles