2

Good afternoon. I need sort the "do" output and change "lokal" to "mikle". But nothing changes it the output of my command. Maybe this command seems silly but it's part of my homework. What's wring?

du | sed 's/lokal/mikle/g' | sort -nk 1

Here is the output.

4                 ./.local/share/applications

the are nearly 100 lines of the output. They all have such forman and many of them have the word "local". Here is what I expect

 4                 ./.mikle/share/applications

So I need only reversed output and nothing more. I don't need to change the name of the directory.

  • That looks fine to me. What does the `du` output look like? – Etan Reisner Mar 19 '15 at 17:02
  • The du command displays the amount of disk space used for file or directory. – Mikhail Zabelin Mar 19 '15 at 17:05
  • 1
    Right, but what does your `du` output look like. Does `lokal` have any non-ascii characters in it that you might be overlooking? – JNevill Mar 19 '15 at 17:07
  • @JNevill Frankly speaking I don't see any non-ascii characters. – Mikhail Zabelin Mar 19 '15 at 17:16
  • @MichaelPister Can you edit your question and add the output of `du`, the output you *actually get* from `du | sed 's/lokal/mikle/g' | sort -nk 1`, and the output you *expected to get*? For an example, see [this unrelated question](http://stackoverflow.com/questions/7619438/bash-read-a-file-line-by-line-and-process-each-segment-as-parameters-to-other-p) which got 12 upvotes for including all the information necessary to debug and reproduce the problem, including code, actual output, expected output, and a description of the difference. – that other guy Mar 19 '15 at 17:33
  • 1
    @thatotherguy I have changed the question – Mikhail Zabelin Mar 19 '15 at 17:43

1 Answers1

2

You misspelled local as lokal. The directory is named .local so change your sed command to

du | sed 's/local/mikle/g' | sort -nk 1
John Kugelman
  • 349,597
  • 67
  • 533
  • 578