In some text file or any configuration file might end with space and to know that below command would be useful. cat -E file.txt
With above command you will know the last character in a line there is space or not. If there is a space character at end of line then you will find space character before dollar sign $ at the end of the line. For example: user@hostname$ cat -E file.txt
Hello World$ Engine start with a sound $ Light is speedier than sound.$ $ |