-2

I want to print the out put of the dig command to a text file .

  • Did you try anything – janith1024 Jun 16 '18 at 04:25
  • dig_output =`dig -f | grep Answer | awk '{printf $1,$2}'` #echo $dig_output >> dig_output.txt – nimanthi peiris Jun 16 '18 at 04:43
  • [What are the shell's control and redirection operators?](https://unix.stackexchange.com/q/159513/56041), [Redirect all output to file](https://stackoverflow.com/q/6674327/608639), [How can I redirect and append both stdout and stderr to a file with Bash?](https://stackoverflow.com/q/876239/608639), etc. – jww Jun 16 '18 at 15:13

1 Answers1

-1

Any Command in shell can be redirected like this:

Example:

dig google.com > k.txt
Shankar Shastri
  • 1,134
  • 11
  • 18