how to remove empty space in a txt file shell code example Example: how to remove all space in file cat file.txt | tr -d " \t\n\r"