문제

How can I remove the ./ on du when I do du on command line

[me@mazaredo 11]# du  --max-depth=1 
96  ./mazaredo
96  ./mazaredo1
1982340 ./mazaredo2
10532   ./mazaredo3
2165964 ./mazaredo4
18764968    ./mazaredo5
도움이 되었습니까?

해결책

May be you 're looking for the below command

du --max-depth=1 | sed s@\./@@g

다른 팁

I used du -m --max-depth=1 | sed 's/[./]//g'

Thanks for replies!

You can achieve by using tr command as follows

du  --max-depth=1 | tr './' ' '

You can't instead need to modify code of du command

If you are looking solution in one line, then this will help

 du --max-depth=1 | perl -n -e "/\\.\\// && print $\\`.$'"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top