title: How can I get output of df -Th to echo particular column value in bash script?
body: <p>I have got the output of <code>df -Th</code> into a test.dat file. Is there a way we could get the particular value from <code>df -Th</code> in specific word such as
  <code>/dev/xvda is mounted on /dev and has file system type tmpfs</code></p>
  
  <p>I have tried the following but could not figure out completely.</p>
  
  <pre><code>#!/bin/bash
  df -Th
  df -Th &gt; test.dat
  filename="test.dat"
  sed 1d $filename | while IFS=, read -r filesystem Type mountedOn
  do
  echo "$filesystem is mounted on $mountedOn and file system type is $Type\n"
  done &lt; $filename
  </code></pre>
  
  <p>The output of <code>df -Th</code>:</p>
  
  <pre><code>Filesystem     Type      Size  Used Avail Use% Mounted on
  udev           devtmpfs  7.7G     0  7.7G   0% /dev
  tmpfs          tmpfs     1.6G  2.2M  1.6G   1% /run
  /dev/nvme0n1p2 ext4      916G   81G  789G  10% /
  tmpfs          tmpfs     7.7G  441M  7.3G   6% /dev/shm
  </code></pre>
  
  <p>Thanks for the help.</p>