Blog Archives

5 Ways To Remove The ^M Character At The End Of Text Files

The Windows text editors place ^M at the end of each line, which is the visual representation for 0x0D, while Unix based systems place 0x0A, in text files. 1. To remove the ^M character, in ViM, write the following in

Tagged with: , , , , , ,
Posted in The Linux and Unix Articles!

Oneliners for Removing the duplicates in your $PATH

Hello Bash Coders. In this article I will show you how to remove the duplicates in your PATH environment variable. This is how you do it with AWK: ONE: $ echo -n $PATH | awk -v RS=: -v ORS=: ‘!arr[$0]++’

Tagged with: , , , , , , , , , , ,
Posted in The Linux and Unix Articles!

How to replace one string with another in a file

In this short article I will show you how to replace a string with another, globally, everywhere it is found. I needed this to replace one extension with another: $ rename ‘-s/\.JPG$/.jpg/’ * This little oneliner looks in all the

Tagged with: , , , , ,
Posted in The Linux and Unix Articles!
Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!