Replace all forward slashes with backward slashes

echo '/usr/bin/' | sed 's|\/|\\|g'
Use -i option to edit directly a file: sed -i 's|\/|\\|g' file
Sample Output
\usr\bin\

2
By: bugmenot
2021-07-15 20:09:34

What Others Think

I was very encouraged to find this site. The reason being that this is such an informative post. Thanks for sharing! cabinet maker installer
janejane · 1 week and 2 days ago
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. My Balance Now
Luis784 · 1 week and 1 day ago
Good News received from the ( COC MOD and GBWhatsapp ) ... This are the only sites that offers us all the latest updated WhatsApp Alternatives.. We can use this WhatsApp on our phone for our primary and secondary WhatsApp numbers...I thought it will be useful for us..That's why I shared it with all of us...Thank you
peterpong493 · 1 week and 1 day ago
I have read your article, it is very meticulous and detailed, the content is also very unique, thank you for sharing this article. [url=https://theimpossible-quizbest.com]the impossible quiz[/url]
candymika · 1 week ago
This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. https://potterswheelmedia.com/search-engine-optimization/
aadityaagarwal · 1 week ago
This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. https://potterswheelmedia.com/search-engine-optimization/
aadityaagarwal · 1 week ago
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. https://www.liteblue.app/
Cooper521 · 1 week ago
This is a fantastic blog post. Your blog post has been quite helpful to us. Following your visit to your article, you will discover a variety of options. I knew exactly what I was looking for. Thank you for such an informative article; please keep it up. https://amongusgame.io https://run3.onl
kanejoyce · 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: