PDA

View Full Version : bash command output as list


gsprague
06-03-2010, 11:54 AM
Using bash is there a way to run this command and have it print as a list. Currently the output is just one line.

du -hr -d 2 /Volumes/Raid

When run in the terminal the output prints in list format per file/directory.

If there isn't an easy way to pipe this to a list then I will get a list of files/dirs with a find and then loop through each line w/du.

Thank you all! ;)

deathdruid
06-03-2010, 12:08 PM
$ man xargs

hayne
06-03-2010, 12:51 PM
Using bash is there a way to run this command and have it print as a list. Currently the output is just one line.

du -hr -d 2 /Volumes/Raid

When run in the terminal the output prints in list format per file/directory.

Please explain more fully how you want to run the command.
Give the exact command you want to use in your script (assuming that you are talking about a script).
It isn't yet clear what you mean. I.e. in what circumstance the output is one line.