-1

example :

diskFreeSpace="$(df | grep -v -E 'Filesystem|udev|tmpfs|Home|/dev/sr1|/dev/sr0' | awk '{ print $5-1+1}')"

and hope if you understand what is this command u help me

  • 1
    But some of those `|` (called "pipes") are in a regular expression, so see also https://stackoverflow.com/q/4736/3001761. – jonrsharpe Jul 03 '18 at 08:38

1 Answers1

-1

the symbol is called a "pipe".

The command df | grep is "piping" (redirecting) the standard output of the df command into the standard input of the grep command. In this example the grep command filters the output of the df command. Then the awk commands is for display/format purposes.

Inside the regular expression it is specific to the grep syntax since it is surrounded by quotes it is only considered as an argument passed to grep

xdrm
  • 399
  • 2
  • 10