I want to remove all the white spaces from a given text file.
Is there any shell command available for this ?
Or, how to use sed for this purpose?
I want something like below:
$ cat hello.txt | sed ….
I tried this : cat hello.txt | sed 's/ //g' .
But it removes only spaces, not tabs.
Thanks.
In order to wipe all whitespace including newlines you can try:
You can also use the character classes defined by tr (credits to htompkins comment):
For example, in order to wipe just horizontal white space: