The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 11-20-2008
rk4k rk4k is offline
Registered User
  
 

Join Date: Nov 2008
Location: /planet-earth/indonesia/jakarta/
Posts: 11
If you want the output is Comma Separated Values like these :

Code:
/dev/sda2, 15519908, 4768020, 9963500, 33%, /
/dev/sda5, 45042712, 30363336, 12391320, 72%, /home
tmpfs, 253156, 36, 253120, 1%, /dev/shm
gvfs-fuse-daemon, 15519908, 4768020, 9963500, 33%, /home/user/.gvfs
/dev/sda1, 15566008, 12771972, 2794036, 83%, /media/disk
Then the script should be like :

Code:
 df -k | tr -s " " | sed 's/ /, /g'
Is that what you look for ?