Mikhail Zabelin
Mikhail Zabelin

Reputation: 23

Bash: sed realization

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.

Upvotes: 2

Views: 35

Answers (1)

John Kugelman
John Kugelman

Reputation: 361575

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

Upvotes: 2

Related Questions