How can i remove trailing blanks?

Asked By 5 points N/A Posted on -

I have two source codes, older and newer version. I can easily find trailing blanks in the older version but was unable to remove them. So please tell me that is there any way to remove trailing blanks in Unix based operating system. If yes how can I do it?

Answered By 0 points N/A #86297

How can i remove trailing blanks?


Hi, first for your record, any file in Linux based systems can be manually edited, and that is one of the strength points of this cool OS. Now lets go back to your issue, you said that you can find what you want to remove but the problem is that you can't remove it. Well, this is due to the file permission, the file you are welling to edit is not yours, in other terms you did not create this file, so in your case only the owner of the file have the permission to edit it. What you need to do is to change the permission of the file : 

  $ sudo chmod o+w file_name_goes_here

 to explain further: because you are not the owner of the file, you are considered in the file permission hierarchy as to be from the "others " category that's why we added the o flag , then we added the write (w) permission to this category, so that you get the possibility to edit the file

 other possible solution open the file in edit mode with root privileges, this may solve the problem

 hope this is helping!!

Login/Register to Answer

Related Questions