質問

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