sed questions
hi:)
i just want to monitor my disk usage by using du command : du -sh /projcts/disk1/ the result: 235M (space) /projects/disk1/firstproject 564M (space) /projects/disk1/secondproject 1.5G (space) /projects/disk1/thirdproject and so on.... but i just want to eliminate all the /project/disk1/ 235M (space) firstproject 564M (space) secondproject 1.5G (space) thirdproject can i use sed to reformat the output of DU command?? please help me thank in advance:) |
I would use awk.
du -sh /projects/disk1/ | awk -F"/" '{print $1, $4}' |
You could do it with sed too:
du -sh /projects/disk1/ | sed 's#/project/disk1/##g' |
hi tells:)
thank for your quick solution to my problem:) now i can monitor my disk usage without the long path file.... THANK! Big help for me:) |
I've used sed a lot at work but have never come across #, what does that mean?
|
Quote:
|
You might also have used
Code:
(cd /projects/disk1/ && du -sh *) |
All times are GMT -5. The time now is 03:31 PM. |